Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
stephenedberkg
Creator II
Creator II

Week Number in master calendar

i have the date field i want to achieve the output like this.

i am using master calendar.

i want to redefine the week.

i had i attach the qvw file.

in my qvw file 2015 have 53 week but i want 52 weeks only like below output.

20152016
WEEKNODATEWEEKNODATE
112/28/2014112/27/2015
21/4/201521/3/2016
31/11/201531/10/2016
41/18/201541/17/2016
51/25/201551/24/2016
62/1/201561/31/2016
72/8/201572/7/2016
82/15/201582/14/2016
92/22/201592/21/2016
103/1/2015102/28/2016
113/8/2015113/6/2016
123/15/2015123/13/2016
133/22/2015133/20/2016
143/29/2015143/27/2016
154/5/2015154/3/2016
164/12/2015164/10/2016
174/19/2015174/17/2016
184/26/2015184/24/2016
195/3/2015195/1/2016
205/10/2015205/8/2016
215/17/2015215/15/2016
225/24/2015225/22/2016
235/31/2015235/29/2016
246/7/2015246/5/2016
256/14/2015256/12/2016
266/21/2015266/19/2016
276/28/2015276/26/2016
287/5/2015287/3/2016
297/12/2015297/10/2016
307/19/2015307/17/2016
317/26/2015317/24/2016
328/2/2015327/31/2016
338/9/2015338/7/2016
348/16/2015348/14/2016
358/23/2015358/21/2016
368/30/2015368/28/2016
379/6/2015379/4/2016
389/13/2015389/11/2016
399/20/2015399/18/2016
409/27/2015409/25/2016
4110/4/20154110/2/2016
4210/11/20154210/9/2016
4310/18/20154310/16/2016
4410/25/20154410/23/2016
4511/1/20154510/30/2016
4611/8/20154611/6/2016
4711/15/20154711/13/2016
4811/22/20154811/20/2016
4911/29/20154911/27/2016
5012/6/20155012/4/2016
5112/13/20155112/11/2016
5212/20/20155212/18/2016
5312/25/2016
9 Replies
migueldelval
Specialist
Specialist

Hi Stephen,

Could you attach xlsx file, please? Or say me what are the labels?

Regards

Miguel del Valle

stephenedberkg
Creator II
Creator II
Author

Hi migueldelval

PFA sheet1 is expected output

sheet 2 is the input for qvw

migueldelval
Specialist
Specialist

Hi Stephen,

Look if it´s correct this example.

Regards

Miguel del Valle

stephenedberkg
Creator II
Creator II
Author

Dear migueldelval

Thanks for your reply

Its not correct.

i tried below expression in script

if(Week(TempDate) = 53,'1',Week(TempDate)) as Week_UP1,Week(TempDate) AS Week_UP,

its working correctly but 2015 & 2016 also its take 1st week.

migueldelval
Specialist
Specialist

Hi Stephen,

Try this example, please.

Regards

Miguel del Valle

stephenedberkg
Creator II
Creator II
Author

Dear migueldelval

I am using personal edition i cant open this Qvw file .

please send the screen shot.

Regards

Stephe Edberk

migueldelval
Specialist
Specialist

Hi Stephen,

This expression: If(Week(TempDate)<53 and Week(TempDate)<>0,week(TempDate)) AS Week_UP,

Regards

Miguel del Valle

stephenedberkg
Creator II
Creator II
Author

Dear migueldelval

i want to take this( 12/27/2015) date as 1st week of 2016.

2014 should have only 52 weeks only

migueldelval
Specialist
Specialist

Hi Stephen,

Then Read this document, I think that apply in your question.

Redefining the Week Numbers

Regards

Miguel del Valle