Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
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
Employee
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 ?