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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
musketeers
Creator
Creator

need help in set analysis

Hi,

I need to get the count of distinct record id where the sum of values is 0.

like if (sum(value) = 0, count(distinct record_id)

but it is not working.

I was thinking if we can write like this:

Count({<$(=sum(Value)) = {0}>}distinct record_id)

but it is also not working.

Please help me here how we can write this situation.

Thanks

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

count({<record_id={'=sum(value)=0'}>}distinct record_id)


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
datanibbler
Champion
Champion

Hi Rajneesh,

I think inside a set_expression, you can only have a "native field" (not an expression) on the left side of the "=" and an expression on the right.

I guess you have several value_fields in one record? And you want to count those where the sum is 0?

So I guess you'll have to calculate another field with the sum in the script so you can use that (but then, when you're at that, make it a binary field (1 or 0) and you can just sum it up, no need for any set_expression anymore.

HTH

Best regards,

DataNibbler

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

count({<record_id={'=sum(value)=0'}>}distinct record_id)


talk is cheap, supply exceeds demand