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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
da_pagnott
Contributor III
Contributor III

Aggr Count Distinct function

Hi guys,

I'm trying to use count distinct function to check how many ID has a total equal to 0 (please see the sample below), but I can't just use count distinct funzion because the format of the input data has more than one row for each ID:

|-----ID-----|     |-----Outcome/Income-----|

001                    +300

001                    0

001                     -150

002                   0

002                   0

003                  +350

003                 -200

 

I need to count how many IDs has a total Outcome/Income = 0 (in this case just one, the ID 002), but if I use just count distinct for ID with the condition Outcome/Income=0 i get 2 as result (ID 001; 002).

How can I proceed?

 

Thank you very much for your help!

Labels (2)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

Try expression like:

Count({<ID = {"=Sum([Outcome/Income]) =0"}>} Distinct ID)

View solution in original post

2 Replies
tresB
Champion III
Champion III

Try expression like:

Count({<ID = {"=Sum([Outcome/Income]) =0"}>} Distinct ID)
Vengatesh
Partner - Creator
Partner - Creator

Try this, If(Aggr(Sum(Value),ID)=0,Aggr(Sum(Value),ID)) as calculated dimension and Count(Distinct ID) as Measure.

You Know What To Do.