Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis vs IF

Hi There

I realise this is a bit of a dumb question but I am just trying to understand something 100%

When is comes to using set analysis or your basic sum(if) for an expression.

Is it correct to say that an "if" is more to refine the data of the current selections, where set analysis is to get data out of the current selections or overriding certain selections?

Basically I want ot be 100% sure when to use set analysis or "if".

Thanx

2 Replies
Not applicable
Author

Sean,

Differ a lot!. Set is a powerfull tool. Set analysis means comparison of record sets.For current selection($), aggregation is in built. You can use this spendidly in charts, for example, to compare results from different selections in the same chart or to compare the sale of 5 successive years/quarters. If you have a small $ script, you can build a more efficient and powerfull output

-Arun

johnw
Champion III
Champion III

Only set analysis can get you outside of your current selections. But you can also use set analysis in many of the ways that you can use IF, and it should normally be faster to process when you can. For instance, perhaps the user is able to select a year, and from that, you want to show a total for the selected year (no condition) but also a total for just one product for that year. You could do this with an IF, but it is likely to process faster if you use set analysis to "select" the product. The results CAN differ, though. If the user also selected a different product, the IF will return nothing, while the set analysis will still return the value for the indicated product. So in many cases it's also a matter of what results you want.