Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
jisephcirspy
Contributor III
Contributor III

If(Sum(<conditions>) = 0, count(var1), Null)

Hello, I want to count all the entries, where the sum equal 0 is. Otherwise it shouldn't count.

I tried:

=If(Sum({<category_name*=-{'Food', 'Clothes'}, [name]*=-{'-'}>} price)={0},Count(id),Null)

Can you help me?

1 Solution

Accepted Solutions
tresesco
MVP
MVP

=Count({<id={"=Sum({<category_name*=-{'Food', 'Clothes'}, [name]*=-{'-'}>} price)=0"}>}id) @jisephcirspy  This?

View solution in original post

4 Replies
tresesco
MVP
MVP

@jisephcirspy  Try like:

 

=Count({<id={"=Sum({<category_name*=-{'Food', 'Clothes'}, [name]*=-{'-'}>} price)=0">}id)

 

jisephcirspy
Contributor III
Contributor III
Author

it prints "Error in set modifier ad hoc element list: ',' or ')' expected" @tresesco 

tresesco
MVP
MVP

=Count({<id={"=Sum({<category_name*=-{'Food', 'Clothes'}, [name]*=-{'-'}>} price)=0"}>}id) @jisephcirspy  This?

jisephcirspy
Contributor III
Contributor III
Author

IT WORKS!! THANK YOU  ❤️