Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

cancel
Showing results for 
Search instead for 
Did you mean: 
AndersGS
Contributor III
Contributor III

Rolling 10 weeks in a QlikView line chart Leap Year issue

Hi guys,

In a line chart I'd like to show a rolling 10 week sale development for current and last year. I'm using "week" as Dimension and two expressions to present the sales data, please see example below. Problem with the leap year is that 2021 week 1 compares to 2020 week 2 etc. so the "week" Dimension won't work (at least this year). Any ideas on how to solve this?  

Example Data:

WeekSales Current YearSales Last Year
1150155
210095
380100
4110115
5160150
6130145
7120100
810095
995100
10105115

 

Running QlikView 11.2 SR 18

Thanks,
Anders

Labels (2)
1 Solution

Accepted Solutions
AndersGS
Contributor III
Contributor III
Author

Hi Chris,

I'm working on adjusting the expressions now, including a variable that checks whether last year has 53 weeks (TRUE/FALSE) - as this is the issue here and not the leap year as you said. Thanks for feedback and help so far.

Anders

View solution in original post

4 Replies
chrismarlow
Specialist II
Specialist II

Hi,

Is this an issue with leap year, or rather an issue with how the weeks break over end of the year?

There are optional parameters broken_weeks  & reference_day in the week function that might help you get the week numbering working in a way that is consistent for your analysis;

week - script and chart function ‒ QlikView

Cheers,

Chris.

AndersGS
Contributor III
Contributor III
Author

Thanks Chris. Broken Weeks could be an option but we are running QV 11.2 which I think only supports one parameter in Week.  Are there any other possible ways around this? 

Anders

chrismarlow
Specialist II
Specialist II

Hi,

Do you have to do this with expressions or could you do something in script? At an extreme could you feed a spreadsheet in with the 'correct' week mapping to join to your calendar?

There may be something possible similar to the fudge that worked on your other query, can you attach some dummy sample data/how you would expect your dates to work (so a couple of week 1/2 etc for a couple of years).

Cheers,

Chris.

AndersGS
Contributor III
Contributor III
Author

Hi Chris,

I'm working on adjusting the expressions now, including a variable that checks whether last year has 53 weeks (TRUE/FALSE) - as this is the issue here and not the leap year as you said. Thanks for feedback and help so far.

Anders