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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variable using aggr

Dear all,

I'm looking for a substitute for an aggregation I'm using alot in my graphs: sum(aggr(column_to_be_summed,aggregation1,aggregation1,aggregation2,aggregation3)). Due to the design of my link table I cannot go arround aggregating before I do the sum.

Is there a way I can replace this with for example a variable?

I want to make it my users as easy as possible to create their own graphs.

Thanks!

1 Solution

Accepted Solutions
forte
Partner - Creator
Partner - Creator

Hi  bluemtms :

Just create a variable named , in example, vMyExp and give it this value :

sum(aggr(column_to_be_summed,aggregation1,aggregation1,aggregation2,aggregation3))

, be sure to not use equal at the begining. Each time you need to use it write $(vMyExp) instead of that sum.

Hope it helps

Regards

View solution in original post

3 Replies
forte
Partner - Creator
Partner - Creator

Hi  bluemtms :

Just create a variable named , in example, vMyExp and give it this value :

sum(aggr(column_to_be_summed,aggregation1,aggregation1,aggregation2,aggregation3))

, be sure to not use equal at the begining. Each time you need to use it write $(vMyExp) instead of that sum.

Hope it helps

Regards

Not applicable
Author

Thanks, I tried this already but failed because I didn't use the sum of the aggr(). I thought I could just store the aggr() in a variable.

This is so easy

Not applicable
Author

Is there somewhere a good reference for working with variables? I don't really understand the difference between LET and SET and the myvar='=expression'...

The reference guide is not really helpful in that aspect