Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

total in pivot table

Hi!

I have a pivot with an expression:IF(min(Month_name)>=(vCurMonth),Sum(Sal*Bench_Data),Sum({<Y={'2015'}>}Fact_bench))

  

Q1Q2Q3Q4
BG_benchBench 2015, USDBench 2015, USDBench 2015, USDBench 2015, USD
BG177,36070,660122,394176,394
BG20000
BG30000
BG40000
BG50000
BG60000
BG70000
BG80000
Total77,36070,660122,394176,394

It works perfectly with quarters, but it doesnt work in 'Total'. The 'Total' shows me only the result of the 1st quarter.

Any ideas how to fix this prob?

7 Replies
Anonymous
Not applicable
Author

It would be great if you can share sample application

buzzy996
Master II
Master II

try this

IF(min(Month_name)>=Sum(Sal*Bench_Data),Sum({<Y={'2015'}>}Fact_bench))


or


IF(min(Month_name)>=(here create/put ur variable for year),Sum(Sal*Bench_Data),Sum({<Y={'2015'}>}Fact_bench))

Not applicable
Author

Nope, this doesnt give me any result

Anonymous
Not applicable
Author

or reset Month_name

Sum({<Y={'2015'},Month_name=>}Fact_bench)

try to use total where datedimension should

Sum(total <yourdatedimension>{<Y={'2015'}>}Fact_bench)

Not applicable
Author

Here is my sample data. As u can see total isnt calculated corrreclty because of the  IF statement, and the calculated dimension isnt working also

ramoncova06
Partner - Specialist III
Partner - Specialist III

change your variable to date((today()),'MMM'), if you use the monthname function QV will consider it a string, but in your script you are actually setting it as a date

Not applicable
Author

When I change the variable to date((today()),'MMM') the expression isnt working