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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
mario-sarkis
Creator II
Creator II

Set Analysis Sum with if condition


Hey

here is my question

How can i write this into a set analysis

if(Type='990' or Type ='sfb' or Type='sfd',Sum(Amount)/Count(trx),Sum(Amount)

how can i write this into a set analysis.

Thanks

Labels (1)
1 Solution

Accepted Solutions
mario-sarkis
Creator II
Creator II
Author

Thanks it works like this

if(Type='990',Sum(Amount)/Count(trx),

             if(Type ='sfb' ,Sum(Amount)/Count(trx),

                   if(Type ='sfd' ,Sum(Amount)/Count(trx),Sum(Amount)

View solution in original post

2 Replies
mario-sarkis
Creator II
Creator II
Author

Thanks it works like this

if(Type='990',Sum(Amount)/Count(trx),

             if(Type ='sfb' ,Sum(Amount)/Count(trx),

                   if(Type ='sfd' ,Sum(Amount)/Count(trx),Sum(Amount)

sunny_talwar
MVP
MVP

Can be simplified like this:

If(Match(Type, '990', 'sfb', 'sfd'), Sum(Amount)/Count(trx), Sum(Amount))