Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variables are not working in pivot table

Hi

I have created a set of expressions in variables which I load from an Excel file. I then loop through the stored variables in the Excel file to load them in my document.

When I use the variable in the table for calculation, the value is not being aggregated properly. I have the same value as the total for all values. This is incorrect.

Consider the following scenario

I have created a variable: vSUMSALES. This has the calculation: SUM(SALES)

I am now using the vSUMSALES variable in another variable: vDaysSales. This has the calculation: SUM(SALES) /SUM(DAYS). This would be alternatively coded to $(vSUMSALES) / SUM(DAYS).

I have a table with 10 unique branch numbers and for each I want to calculate the Day Sales.

When I use the expression in a pivot table it works fine giving an individual Day Sales for each branch. When I use the expression I get the same figure in the Day Sales value.

What am I doing wrong?

Thanks

2 Replies
Gysbert_Wassenaar

No idea, why don't you post the document so we can see what you're actually doing in it. See this document for how to to do that: Preparing examples for Upload - Reduction and Data Scrambling


talk is cheap, supply exceeds demand
marthacano01
Partner - Creator
Partner - Creator

Hi RAjesh.

Try this:

I attached an example to explain it better.

The difference is the equal sign in the variable. You need to quit the equal sign if you will use your variable in the report.