Difference actual week- week prev year
Hello,
we would like to calculate the difference of an KPI actual year vs Previous year on weekly base (KW this year - KW prev Year). We have time attributes for Date, KW (i.e. KW40), Week Sequence (i.e.202340), Year etc)
I managed to calculate the difference by using current KW and Lag 1 on Year, but the problem is that we need to filter on the last 6 Weeks. When i do this, i loose the values of the previous year. Does anyone have a solution for my problem?
Regards Janine
4 replies
-
What is KW - a measure or an attribute?
Also clarify what you mean by '6 week filter'. Are you Including this inside the KPI somehow or are you using the filter in your report that contains the KPI?
-
KW is calender week ==> an attribute of the time dimension. We need to build a formular (measure) that calculates the difference between actual week and same week number previous year for a measure. We want to use the original measure and the difference in a single discover (bar chartwitl trellis). We need to filter the chart on the last six weeks for the original measure anfd we want the difference to be shown above in a seperate trellis.
-
Hi Janine,
Use the dynamic list editor to create a list of the last 6 weeks. Select this list to appear in your Discovery and select your Lag 1 calculation for the previous year. Last year's values should show up because you are not now filtering on the weeks in the View, but re doing that in the dynamic list.
Hope that helps.
Ian