Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
aveeeeeee7en
Valued Contributor III

Week Logic Requirement..............???

Dear All
I need to Categorize the Weeks for every month as Week1, Wee2,.........
 
If I use this:
'Week'&Ceil(Day(New_Date)/7) as  Weeks
than i am getting the Weeks as Week1, Week2,......
but the problem with this is it is calculating the Weeks as Week1 =  1-7, Week2 = 8-14..................
I don't want this.
I want to calculate Weeks as: Suppose take a example for January 2015 than:
Week1 = Thu, Fri, Sat, Sun (1,2,3,4)
Week1 = Mon, Tues, Wed, Thu, Fri, Sat, Sun (5,6,7,8,9,10,11)............................
Please find the enclosed Sample File for reference.
Regards
Av7eN
Tags (1)
2 Replies
aveeeeeee7en
Valued Contributor III

Re: Week Logic Requirement..............???

Any Suggestion??

anbu1984
Honored Contributor III

Re: Week Logic Requirement..............???

Src:

LOAD Required???,

     WeekDay,

     SampleDate,

     WeekNumber,    

     Week(SampleDate) As WeekNo

FROM

[Sample File.xlsx]

(ooxml, embedded labels, table is Sheet1);

Join(Src)

Load WeekNo,'Week'&AutoNumber(RecNo(),Mth) As Weeks ;

Load WeekNo,Max(Month(SampleDate)) as Mth Resident Src Group by WeekNo Order by WeekNo asc;

Community Browser