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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis performance

Hi All,

Option 1

Sum({<Year={'2014'},Month={'Jan'}>}Sales+Profit)

Option 2

Sum({<Year={'2014'},Month={'Jan'}>}Sales)+

Sum({<Year={'2014'},Month={'Jan'}>}Profit)

please can you let me know whether option 1 or option 2 is better in performance and why

2 Replies
swuehl
MVP
MVP

It's always best to run tests on your specific model and data to answer questions like these.

I would assume that option 1 is faster, just because it's only using one aggregation and one set analysis, but I could be wrong.

The results of both options may differ though, if Sales or Profit field may contain NULL.

Use

Sum({<Year={'2014'},Month={'Jan'}>} Rangesum(Sales,Profit) )

to be on the safe side.

miguelbraga
Partner - Specialist III
Partner - Specialist III

Hey there,

To maximum increase performance do the following:

In the script create a field like this:

     Sales + Profit as SalesProfit,

This will take less time then using Set Analysis in a expression in any chart. Tipically we want to put the most complex calculations and test in script and then use the least complex code in chart to increase the performance. So by doing the above scripting you'll only need to do a Set Analysis like this:

Sum({<Year={'2014'},Month={'Jan'}>} SalesProfit)


Doing this is better then any option you've given to us


Regards,

MB