Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Storing the straight table's Total Mode of a column in a variable for later reference

Say you have a straight table containg  multiple rows (using one dimension) and just one column (one expression). The formula used to arrive at the individual row values is complex [uses divisions, multiplications, set analysis]. The total of the column however is merely the sum of the rows and hence I'm setting the Total mode to "Sum of rows". Now I want this total (which appears in the top most row, above the first row) to be stored in a variable for use in other computations. How do I achieve this?

Help much appreciated.

Regards,

Gopal

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You should be able to use advanced aggregation in your variable definition to achieve what you want:

In variable overview, use this expression as definition:

=sum( aggr( YourComplexExpressionFromTheTable, YourDimensionFromTheTable))

You might run into some issues if you are using chart inter record functions in your complex expression, like above(), but you haven't listed that

View solution in original post

4 Replies
swuehl
MVP
MVP

You should be able to use advanced aggregation in your variable definition to achieve what you want:

In variable overview, use this expression as definition:

=sum( aggr( YourComplexExpressionFromTheTable, YourDimensionFromTheTable))

You might run into some issues if you are using chart inter record functions in your complex expression, like above(), but you haven't listed that

Not applicable
Author

Piece of cake! Thanks swuehl.

Not applicable
Author

This was exactly what I was looking for. Thank you very much.

Monika2828
Contributor
Contributor

Hi,  It'd be great if you could suggest what to do if i'm using above() in my expression? TIA