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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
amars
Specialist
Specialist

Week function to work on Calender week

Hi all,

I have a MonthName, & I wish to divide the month in 5 week's Week1, week2,..........Week5. But suppose if the month is Apr 2010 then it's first week :- has only 3 days since 1 st falls on Thursday. So I should get Month :- April 2010 Week :- Week1, WeekStartDate :- 01-Apr-2010 Week End Date :- 03-Apr-2010, Similarly Week2 Week2StartDate:- 04-Apr-2010 Week2EndDate:- 10-Apr-2010

and Week:- Week5 , WeekStart Date :- 25-Apr-2010 , WeekEndDate:- 30-Apr-2010.

If anyone knows how to do that for every month including feb please let me know. Thanks in advance.

With Regards

Amar

2 Replies
Not applicable

I've attached something I've used...

You'd only need to name the first day of your range, and I presume the last one.

Not sure if this'll help 🙂

johnw
Champion III
Champion III

OK, it sounds like you want your week to start on Sunday instead of on Monday? And you want your week numbers to start and end in each month?

1+ceil((Date-floor(weekend(monthstart(Date),0,-1)))/7) as "US Week but Start and End in Month"

See attached for the results.