Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi all
i need help with aggregation
i aggregate data
LOAD
F1,F2
,count(Id)
from fileSource
GRoup By
F1
,F2
;
however this doesn't display satisfied results. What is wrong with my script can someone tell me pls?
If you're getting an inflated figure it may be that you need to do count(distinct Id).
Otherwise, can you post a sample of your data and the expected results?
It's better to provide (a) source data and/or (b) working/runnable qv-script.
Neither (a) nor (b) I can see here, so it's hard to advice.
Please find working example, hope this will help somehow:
// BEGIN
fileSource:
load * Inline
[
id,F1,F2
1,1,1
2,1,2
3,2,1
4,2,2
5,1,2
6,2,2
];
LOAD
F1,F2,count(id)
Resident fileSource
GRoup By F1,F2;
drop Table fileSource;
// THE END
Best regards,
Maxim
can you upload a sample document and tell us what is the desired outcome, maybe you need to use distinct instead of count().