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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to sum based on 2 conditions

I like to sum a total amount based on 2 criterias, ID and LOS. Ex: If a record has an ID of I and a LOS >= 1 then sum the total.

How can I code this?

Thanks. 

3 Replies
mike_garcia
Specialist
Specialist

Set Analysis will do

Sum({$<ID = {'I'}, LOS = {">=1"}>} Amount)

Mike.

Miguel García
Qlik Expert, Author and Trainer
Anonymous
Not applicable
Author

Hi Mike,

Thanks for the info but it does not work. The sum is a lot bigger then what it should be.

LOS is a column with value range from blank to 1 to 55. Thus, the LOS >= 1. I wanted to get a sum in which LOS has value.

Thanks.

mike_garcia
Specialist
Specialist

Maybe the Blank Value gets evaluated as being >=1. So, use this instead:

Sum({$<ID = {'I'}, LOS = {">=1<=55"}>} Amount)

Miguel García
Qlik Expert, Author and Trainer