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: 
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
Partner - Champion III
Partner - Champion III

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
Partner - Champion III
Partner - Champion III

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.