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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis Expression without IF Statement

Would anyone know if the following set analysis expression can be re-written without using an IF statement?

if(SubStringCount(Concat(distinct %Time_Dim_ID, '|'), 'B'),

   sum({$<[PeriodType]={'R12'}>} [Dollars]),

   sum({$<[PeriodType]={'R12'}, [CalYear]={$(=max([CalYear]))}, [CalPeriod]={$(=max([CalPeriod]))}>} [Dollars]))

1 Reply
JonnyPoole
Former Employee
Former Employee

You could create 2 different expressions and enter the condition in the 'Conditional' expression so that each expression only calculates when the condition is met.

but it would depend on what you are trying to accomplish.  Can you elaborate on why you want to remove the IF ?  Performance ? Easy to read ?   or something just not working ?