mihaifm / linq

linq.js - LINQ for JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

group by with sum producing wrong results

manish-shukla01 opened this issue · comments

has someone else seen this. i have large amount of data on which i am doing group by operations..like (1500 rows of data) and when i do group by it does not produce the correct result. it adds the numeric column correctly but puts the amount in wrong key. i tried doing it and matching wit excel pivot table and my results are not tying. has anyone else seen it?

commented

It would be nice to see a reproduction.

Does the data have any javascript reserved words as keys?

it was weird issue. it got fixed when i changed the data type forcefully to number before doing sum operation. i think it was somehow thinking there are some strings in data.
one other issue, is it possible get sum of one value and max of another value. e.g. select a, b,c, max(d), sum(e) from table group by a,b,c

between thank you @Schenn and @M0ns1gn0r