Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
spikenaylor1
Creator
Creator

Rolling 52 Weeks Chart

My script Load dimension is:

calcs:

Load *,

  MonthName([Date Document Final Approved]) as Month,

  YearName([Date Document Final Approved]) as Year,

  WeekEnd([Date Document Final Approved]) as weekend,

  Resident main;

  Drop table main;

My chart dimension is:

weekend

My chart expression is

=num(sum({1}RFT)/Count({1}RFT),'#.##%')

been asked now to display the chart as a rolling 52 weeks chart

Tried a few options I have found but not able to get to work

any pointers or guidance please

Many thanks for looking and helping

3 Replies
vinieme12
Champion III
Champion III

Create a WeekNumber field

then you can restrict to latest 52 weeks as

WeekNum >= Max(WeekNum)-52 <=Max(WeekNum)

See the attached

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Kushal_Chawda

may be below expression

num(sum({1<[Date Document Final Approved]={">=$(=date(max([Date Document Final Approved])-357))<=$(=date(max([Date Document Final Approved])))"}>}RFT)/Count({1<[Date Document Final Approved]={">=$(=date(max([Date Document Final Approved])-357))<=$(=date(max([Date Document Final Approved])))"}>}RFT),'#.##%')

jurriejoachim
Contributor
Contributor

Hi Mike,

It took me al while to find "weeks ago " that worked with the end of a year. Like datediff in SQL. But if you put this in your script you got rolling weeks ago that even work in January.

((weekname(Today())) - (weekname([datum])))/7 as WeeksAgo,

And in my object I use

=if(MixMatch(WeeksAgo,'1','2','3','4','5')>0,Verzoeken.Year_Week,Null())

and supress when value is Null

best regards Jurrie