Discussion board where members can get started with Qlik Sense.
Is it possible to get Year-over-Year Comparison based on quarter by keeping Year as dimension in straight table as below example:
For example : 2012 Q1 Sales is compared with 2011 Q1 and percent difference is populated in 2012 Q1 Record.
Is any workaround in Qlik, to get the same ?
Thanks in advance
Go to Solution.
You can try this
=Sum(Sales)/Aggr(Above(Sum(Sales)), [Quarter of Order Date], [Year of Order Date]) - 1
But if you data is not sorted in the ascending order, you might need to use this (this below expression will only work in QV12 or above)
=Sum(Sales)/Aggr(Above(Sum(Sales)), [Quarter of Order Date], ([Year of Order Date], (NUMERIC))) - 1
Alternatively, you can use The As-Of Table
Thanks for your reply@ Sunny Talwar...
It works perfect !
But just a small doubt : By removing NUMERIC from expression
Sorting is not happening correctly, even though my Year field in table is sorted ascending.
Can you help me with the cause of this, why it is so:
That is because of the use of Aggr() function... Aggr() over rides the sorting from the chart and use the sorting from the load order
oh ok !!!
Thanks for your guidance.