Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
cemppa00
Contributor
Contributor

Plotting values on a different week number than in the data with a restraint

As 2020 was a leap year, I have a rolling 52 weeks line/bar chart that has 2 expressions. first is for the current rolling 52 weeks and the second is for the reference period, so it does a YoY comparison. The problem is that due to the leap year I have to compare week 1 of 2021 to week 2 of 2020. I could do this with Above() like "(Column(1)-Above(Column(2), 1))/Above(Column(2),1). That does work for 2021, but how do I add a restraint that it only uses Above for data of 2020?

 

The rolling 52 weeks expressions are as follows:

Current 52: sum({<OrderStartedYear=,StartWeekYear=,OrderStartedWeek-={53}, StartedDate={'>=$(=WeekStart(Max(StartedDate), -51))<=$(=Date(Max(StartedDate)))'}>}Amount)

Previous 52: sum({<OrderStartedYear=, OrderStartedMonth=,OrderStartedWeek-={53}, StartWeekYear=, StartedDate={'>=$(=WeekStart(Max(StartedDate), -104))<=$(=WeekStart(Max(StartedDate), -52))'}>}Amount)

The dimension in the graph is weeknumber.

Thanks in advance.

Labels (2)
1 Reply
cemppa00
Contributor
Contributor
Author

Anybody?