Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Live chat with experts, bring your API Integration questions. June 15th, 10 AM ET. REGISTER TODAY
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Why is there a need to specify the same set expression twice?

Why do I have to specify the same set expression ( {<Year={2012}>} ) twice? First time for sum() and second for max().

=Max({<Year={2012}>} aggr (sum( {<Year={2012}>} Sale),Company_Name,Product))

Initially I though there would be enough to state it for sum, so that only the rows for 2012 would be passed on to the max().

I have taken the example from:


The blogger states that the expression is needed twice, but unfortunately not why.

3 Replies
Not applicable

I believe it is only a waste of processing

The Set Expression with the definition only in the sum statement works perfectly!

=Max( aggr (sum( {<Year={2012}>} Sale),Company_Name,Product))

A "set statement" creates a static set of data, should be included only in the part that defines the value

Not applicable

As I stated in my initial post and stated by the original blogger, both are needed to get correct result.


Each aggregation function can leverage a unique set statement whether or not its inclusive of the inner set or not. This is for maximum flexbility

Below for example, the inner set is on AccountID=1 , but the outer set is on AccountID=2

so what happens ?

the outer is what is used on where to render the values, but the inner set  is being used for the subtotalling .

pretty flexible.