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: 
HamJan
Contributor II
Contributor II

Showing ID if Sum of Cost is 0

Hi.

I have table that has ID field, product field and Sum Cost field. One ID can have multiple product of all  different costs.

How to use expressions so that i get only those ID:s that have sum of costs to equal zero.

ID|Product|Cost

1|P1|10

1|P2|20

2|P1|0

2|P2|0....

In this example i would have only ID 2.

Labels (4)
1 Solution

Accepted Solutions
MayilVahanan

Hi

Try like below

Its depends on where you are going to include

Dim: =Aggr(Only({<ID={"=Sum(Cost)=0"}>}ID), ID)

or

Exp: Only({<ID={"=Sum(Cost)=0"}>}ID)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

4 Replies
MayilVahanan

Hi

Try like below

Its depends on where you are going to include

Dim: =Aggr(Only({<ID={"=Sum(Cost)=0"}>}ID), ID)

or

Exp: Only({<ID={"=Sum(Cost)=0"}>}ID)

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
HamJan
Contributor II
Contributor II
Author

@MayilVahanan Both give only NULL

MayilVahanan

its working fine for me. can you post your screenshot..

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
HamJan
Contributor II
Contributor II
Author

@MayilVahanan  I must have had some error the first time i tried it, beacause now it works. Thank you.