Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Aggregate Multiple fields

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?

3 Replies
marcus_malinow
Partner - Specialist III
Partner - Specialist III

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?

maksim_senin
Partner - Creator III
Partner - Creator III

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

maleksafa
Specialist
Specialist

can you upload a sample document and tell us what is the desired outcome, maybe you need to use distinct instead of count().