Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Offsetting the week# for one's own own fiscal calendar

I would like to apply an offset to the week# function so that I define week#1 for an entire year.... this would be a for a school candar... if this year's start data is 18Aug2010 for a particular school, weeknum(18Aug2010)= 1.... through the end of the school year. And to dynamically create new week# for future years.

Any ideas?

Stephanie Lind

1 Solution

Accepted Solutions
Not applicable
Author

Dear Anatoly,

thanks a bunch! This is indeed what I'm looking for. What was very helpful for me was the code that you sent, since I'm still a QV novice. Thanks again 🙂


Stephanie

View solution in original post

4 Replies
sparur
Specialist II
Specialist II

I think you can use a WeekName() function. for example: Date = 18 Aug 2010 Standard week (=week(date#('18.08.2010', 'DD.MM.YYYY'))) = 33 so you can create an offset in WeekName function: weekName(TempDate, -32) as WeekNameOffSet for more details, see in my attachment

Not applicable
Author

Dear Anatoly,

thanks a bunch! This is indeed what I'm looking for. What was very helpful for me was the code that you sent, since I'm still a QV novice. Thanks again 🙂


Stephanie

Not applicable
Author

I'm still playing with your code...

I would like my final week variable to be displayed like this 'wk1-Aug-2006' ..... ' wk45-Jun-2007' . I plan to use these wk# along a control chart X-axis and to group grades by this week. So the month stats the same, but I concatenate the offsetting week (I think? ).

where wk1-Aug-2006 was original transdate=20Aug2006, and wk45-Jun-2007 was original transdate=22Jun2007

Your thoughts?

sparur
Specialist II
Specialist II

Hello, Stephanie.

I don't sure that understand you, but created some small modifications. see in attachment.

If I don't understand so you can explain me more clearly.