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

Variable Question

In one of my pivot tables I get the grand totals for each column (formula) showing.  I want to convert that total into a variable so that I can calculate the percentage of each row as a percent of the total for each column.   How can I declare the column total as variable.  Please  helpl

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

Hi,

Create a variable and give the expression you used in the Pivot table. 

Now use this variable in your expression

=Sum(Revenue)/$(vTotal)

or you can use directly without creating any variable

=Sum(Revenue)/Sum(TOTAL Revenue)

TOTAL doesn't consider the dimension, so you will get the Column total when you use TOTAL in expression.

Regards,

Jagan.

View solution in original post

2 Replies
Qvmaster2019
Creator
Creator

Is it possible to attached the file you are currently working on?

jagan
Luminary Alumni
Luminary Alumni

Hi,

Create a variable and give the expression you used in the Pivot table. 

Now use this variable in your expression

=Sum(Revenue)/$(vTotal)

or you can use directly without creating any variable

=Sum(Revenue)/Sum(TOTAL Revenue)

TOTAL doesn't consider the dimension, so you will get the Column total when you use TOTAL in expression.

Regards,

Jagan.