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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
jblomqvist
Specialist
Specialist

What is a performance efficient way to write SUM expression with nested AGGR inside?

Hi,

Let's say I have an expression like this:

SUM(

Pick($(vSelectorValue),

Aggr(Sales),

Aggr(Orders),

Aggr(Shipments)

)

The idea is to SUM one of the Aggr values based on the variable value of vSelectorValue.


Is the above expression an efficient way to write? Is there a better way to write the expression to make it efficient?

Of course I am aware that Aggr can be performance impacting but my question is around the above expression.

3 Replies
sunny_talwar

Why do you need Aggr() here? Is Sales, Order, and Shipments expressions or fields? If they are fields, why don't you just do this

Sum(Pick($(vSelectorValue), Sales, Orders, Shipments))

jblomqvist
Specialist
Specialist
Author

Hi Sunny,

It's because I am presenting a simplified version for the question.

In reality my Aggr is a bit more complex and contains variables etc inside.

sunny_talwar

Without seeing the real thing, it might be difficult to suggest ideas for improvement...