Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Formula to calculate the week start date with Monday as beginning of week.

I have an [Audit Date] field. I would like to create a simple formula that will determine the week starting date (with Monday as the week starting date). for example, if the [Audit Date] = 03/21/2018, I would like the Week Start Date to show  03/19/2018.  If the Audit date was 02/09/2018, the week start date should be 02/05/208.

What is the best formula to use?

5 Replies
ychaitanya
Creator III
Creator III

Can you try re-setting the below setting in  Load Script Editor in QlikSense.

Default:

SET FirstWeekDay=6;

Change to SET FirstWeekDay=1;(i think 0 or 1 try)?


Thanks

CY

zebhashmi
Specialist
Specialist

you can use WeekStart(date [, period_no = 0 [, first_week_day=0]])

zebhashmi
Specialist
Specialist

weekstart('12/01/2013')Returns 07/01/2013.
weekstart('12/01/2013', -1 )Returns 31/11/2012.
weekstart('12/01/2013', 0, 1)Returns 08/01/2013.
Anonymous
Not applicable
Author

I am confused how this formula would take a date, such as 02/09/2018, and return a week start date of 02/05/2018.

zebhashmi
Specialist
Specialist

as it is it should return the 02/05/2018

huuu

ok try this

WeekStart('02/09/2018',0,0)