Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello,
I would like to create a variable which give me the last friday as a date. But I have no idea how to calculate that.
Best regards
Pia
You should be able to do this using https://help.qlik.com/en-US/qlikview/May2023/Subsystems/Client/Content/QV_QlikView/Scripting/DateAnd... by specifying the first_week_day optional parameter. Alternatively, you can check the weekday of the date in question and then subtract the appropriate number of days (e.g. two days if it's Sunday) to get the prior Friday.
You should be able to do this using https://help.qlik.com/en-US/qlikview/May2023/Subsystems/Client/Content/QV_QlikView/Scripting/DateAnd... by specifying the first_week_day optional parameter. Alternatively, you can check the weekday of the date in question and then subtract the appropriate number of days (e.g. two days if it's Sunday) to get the prior Friday.
Next Friday = Date(WeekStart(Today(1), 1, 4), 'DD/MM/YYYY')
Last Friday = Date(WeekStart(Today(1), 0, 4), 'DD/MM/YYYY')