Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis - Performance Issue

I have a straight table where I have about 7 expressions. I converted the expressions from normal if statements to if's with set expressions. The values appear correct, the filtering works fine. The only issue is performance. It seems when run side by side the converted expressions (set expressions) take noticably longer to refresh than the plain if statement expressions. Is there something wrong with the logic I use or is this an inappropriate use of Set Analysis?
Samples are as follows:
Original Expression:
Sum(IF([Field1] = ‘Var1’, [SomeSales], [SomeOtherSales]))
"Converted" Expression:
If([Field1] = 'Var1',
Sum({$<Field1 = {Var1'}>} [SomeSales]),
Sum({$<Field1 = {'Var2'}>} [SomeOtherSales]))
1 Reply
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    First thing i would like to tell you that, the use of setanalysis is not proper.

    Sum({$<Field1 = {Var1'}>} [SomeSales]), this expression itself contains the if statement. Meaning it will give you sum of SomeSales only if Field1 = Var1. So it will be purly for Var1.

    Now as far as performance is concerned the 'if' within sum() takes less time to calculate then sum() in if statement.

    Thus your converted expression takes more time to calculate then your first expression.

    Hope you understood.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!