Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Mahajan
Contributor II
Contributor II

Set Analysis using Multiple If Statements

Hi,

Can anyone help me  to write below expression using Set Expression :

=If(Status='Imported','Not Available', If(Sum(Price)<>0,Sum(Price), If(Sum(Cprice)<>0,Sum(Cprice),If(Sum(Dprice)<>0,Sum(Dprice),sum([Dummy Price])))))

 


Thanks

1 Reply
treysmithdev
Partner Ambassador
Partner Ambassador

Your expression is conditional. I do not think you can replace what you are doing leveraging Set Analysis. You could do that if you were defining your selection criteria using IF statements, but you are changing the expression itself.

Also, note that Set Analysis happens before the dimensionality so if won't change the data by the dimension value's result (Ex: Sum(Price)<>0). 

Your best case scenario is to modify your data model to accomodate this logic. 

Blog: WhereClause   Twitter: @treysmithdev