Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
QVUser1
Partner - Contributor III
Partner - Contributor III

Create a Master Calendar based on required Weekstart

I  have a Date Field Where it gives all the Dates in a year . from this date  I need to derive Weeks as per the requirement .

For Every month Starting week start will be starting day of the month and for other weeks it should consider as Monday.

 

Example : For the month of Jan & Feb Months :

 
 

Example.PNG

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Try this.

Let vMin = Num(Makedate(2020,01,01));
Let vMax = num(Today());

Temp:
Load Date($(vMin)+RowNo()-1) as Date
AutoGenerate 1
While Date($(vMin)+RowNo()-1) <Date($(vMax));

Output:
Load Date,Weekstart(Date,0,0) as Weekstart,
If(Monthname(WeekStart(Date,0,0))<>Monthname(Date),Monthstart(Date),Weekstart(Date,0,0)) as New_WeekDay
Resident Temp;

 

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!

View solution in original post

1 Reply
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Try this.

Let vMin = Num(Makedate(2020,01,01));
Let vMax = num(Today());

Temp:
Load Date($(vMin)+RowNo()-1) as Date
AutoGenerate 1
While Date($(vMin)+RowNo()-1) <Date($(vMax));

Output:
Load Date,Weekstart(Date,0,0) as Weekstart,
If(Monthname(WeekStart(Date,0,0))<>Monthname(Date),Monthstart(Date),Weekstart(Date,0,0)) as New_WeekDay
Resident Temp;

 

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!