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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Aggragating variable in set analysis

Hello all,

I'm simply trying to use a variable (vCommissionableTotalSales) in my set analysis like this:

Sum({$<Month={'=Month(today())'}>} $(vCommissionableTotalSales))

...which gives me an error: Nested aggregation not allowed. Is this not possible to do?

8 Replies
MK_QSL
MVP
MVP

What is the definition of vCommissionableTotalSales?

Not applicable
Author

Where are you using this expression?

Not applicable
Author

vCommissionableTotals = Sum({$*BM13} [Sales Amount])

MK_QSL
MVP
MVP

Remove SUM

Only({$*BM13} [Sales Amount])


and try

Not applicable
Author

Not sure if you meant "{$*BM13} [Sales Amount]" or "Only({$*BM13} [Sales Amount])", but I tried both as the variable definition. The first gave an error and the second returned null.

MK_QSL
MVP
MVP

My Mistake,,,, Only will not work here... will check and come back to you on this

Not applicable
Author

I'm actually trying to use this in a text box. In the full expression I'm adding "=" to the beginning.

Not applicable
Author

I ended up just adding to my set analysis the criteria used in the variable's set analysis like so:

Sum({$*BM13<Month={$(=Month(Today()))}>}[Sales Amount])

Worked just fine. Just thought it'd be easier to use the variable.