Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
My issue is, I need to create a calendar in which weekstart date should change according to my weekday. Ex. If I select weekday as Tuesday then my weekstart date should automatically change to Tuesday.
Regards,
Yasmeen
The Weekstart function accepts an parameter for the day that should be used as the start of the week: weekstart ( '2016-01-12', 0, 2 ). If that should depend on a selection then use a variable with an expressions that calculates the weekday number of the selected day and use that weekstart ( '2016-01-12', 0, $(vWeekDayNumber) )
Just a minor correction, I think WeekDay start counting from 0
(equals Monday, using default weekday counting, i.e. if not changed in script in a recent QV version).
Hence Tuesday would probably be represented by 1, this should be used as weekstart offset when you want to start the week on midnight between monday and tuesday.
weekstart ( '2016-01-12', 0, 1 )
You're absolutely right. I often get this mixed up.
Me too. Index start is not consistent in Qlik between functions