Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
GraceGao
Creator
Creator

Pivot Table

Hi Experts,

I would like to add one column before the monthly sales as below screenshot. could any way to achieve this? Thanks.

2 Replies
OmarBenSalem

I'll assume this is your data : 

Load * Inline [

Year, Measure, Month , Produt
2020 , 100 , 1 , A
2020 , 300 ,2, A
2020 , 400,3, A
2020 , 300,4, A
2020 , 600,5, A
2019 , 200,1, A
2019, 300,2, A
2019 , 500,3, A
2019 ,100,4, A
2019 , 1000,5, A

2020 , 360 , 1 , B
2020 , 300 ,2, B
2020 , 700,3, B
2020 , 800,4, B
2020 , 900,5, B
2019 , 200,1, B
2019, 320,2, B
2019 , 600,3, B
2019 ,150,4, B
2019 , 900,5, B

];

Create a pivot table : 

as line Product

as columns : Month, Year

as a measure : sum(Measure)

Now, create as a second line :

=num(aggr((Sum({<Year={"$(=max(Year))"}>}Measure) -
Sum({<Year={"$(=max(Year)-1)"}>}Measure))
/
Sum({<Year={"$(=max(Year)-1)"}>}Measure),Produt),'# ##0,00%')

this will be your CY vs LY% 

For it to be, uncheck this : 

Capture.PNG

and here you go :

Capture.PNG

GraceGao
Creator
Creator
Author

can display total %?