Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
aria_123
Contributor
Contributor

Sum with multiple conditions

How do I sum based on multiple conditions?

I only want the approved and pending Status sum cost from Type=issue.  

Type == Issue  AND (Status != "Rejected" OR  Status !="Rejected")

    =Round (Sum ({<Type={'Issues'}, Status -={'Rejected'} , Status -={'Canceled'}>} [Cost Ratio]), 0.01)

But with this, I keep getting the "Rejected" ones.   It does exclude the "Canceled" items. 

Labels (1)
1 Solution

Accepted Solutions
jonnaamb
Contributor III
Contributor III

Hello Aria,

The same modifier cannot be given twice in one expression. When you give 'Status' twice, it is considering the second 'Status' as null. I've attached a screenshot as to how Set Analysis can be remembered easily. 

The ideal expression would be this:

=Round (Sum ({<Type={'Issues'}, Status -={'Rejected','Canceled'}>} [Cost Ratio]), 0.01)

Best regards,

Ambareesh

View solution in original post

3 Replies
Vegar
MVP
MVP

Try this expression:
=Round (Sum ({<Type={'Issues'}, Status -={'Rejected','Canceled'}>} [Cost Ratio]), 0.01)
Plees ekskuse my Swenglish and or Norweglish spelling misstakes
jonnaamb
Contributor III
Contributor III

Hello Aria,

The same modifier cannot be given twice in one expression. When you give 'Status' twice, it is considering the second 'Status' as null. I've attached a screenshot as to how Set Analysis can be remembered easily. 

The ideal expression would be this:

=Round (Sum ({<Type={'Issues'}, Status -={'Rejected','Canceled'}>} [Cost Ratio]), 0.01)

Best regards,

Ambareesh

View solution in original post

aria_123
Contributor
Contributor
Author

Wow.  Thanks for quick responses.   It works!