
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sum with multiple conditions
Dear Qlik Community,
I am new to Qlik sense and currently trying to sum with condition. I have a sample equation where I am trying to sum qty by multiple conditions.
My result is incorrect with Sum(if([TRACKINGSTATUS]='1', '8' and [DELETEDBY]='0', [QTY])).
I want to sum Qty if TRACKINGSTATUS ='1' & '8' and DELETEDBY =0 or alternatively use variable function.
Expected result in Chart = 10 for 2018 and 50 for 2022.
Thanks in advance.
Samson O'David
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As you see Tracking Status is numeric, so to compare two such numbers, 1 & 8 you need to do two such comparisons:
If (([TrackingStatus=1 Or TrackingStatus= 😎 and [Rest of the comparison])

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your response, however the result is still incorrect
Sum(if([TRACKINGSTATUS]='1',[TRACKINGSTATUS]= '8' and [DELETEDBY]='0', [QTY]))

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try this;
SUM({<[TRACKINGSTATUS]={'1','8'},[DELETEDBY]={'0'}>}[QTY])

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Awesome. Thanks!
