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

Pivot table Calculation

This is the structure of the table

  

Row LabelsSum of SalesSum of Revenue
20153800024700
Q32400015600
Jul80005200
Aug70004550
Sep90005850
Q4140009100
Oct20001300
Nov50003250
Dec70004550
20165800037700
Q1140009100
Jan90005850
Feb40002600
Mar1000650
Q21700011050
Apr50003250
May50003250
Jun70004550
Q32700017550
Jul80005200
Aug90005850
Sep100006500
Grand Total96000

62400

In QV I need to design the same table with an additional calculated measure where i need to display the ratio at the month level against the total at the quarter level. For eg: 2015-Q3-Jul-8000(Sales) should be compared against 2015-Q3 total of 24000,ie.. 33%.

At the quarter level and the year level the above calculation has to be ignored.

How to achieve this ?

1 Solution

Accepted Solutions
sunny_talwar

Is this what you are looking for?

Capture.PNG

Expression:

=If(Dimensionality() = 3, Sum(Sales)/Sum(TOTAL <Quarter, Year> Sales), Sum(Sales)/Sum(TOTAL <Year> Sales))

View solution in original post

3 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Try with

Sum(Sales) / Sum(aggr(Sales, Quarter))

let me know

sunny_talwar

Is this what you are looking for?

Capture.PNG

Expression:

=If(Dimensionality() = 3, Sum(Sales)/Sum(TOTAL <Quarter, Year> Sales), Sum(Sales)/Sum(TOTAL <Year> Sales))

Not applicable
Author

Yes Sunny, this is what I am looking for.

This works. Thank you