Discussion Board for collaboration related to QlikView App Development.
I have successfully used this expression to get the first day of last week last year:
but when using this expression today I get 2019-12-30 rather than 2020-01-06 because the week numbers differ 2020 vs 2021
any ideas on how to alter this formula to get it right?
Running QlikView 11.20 SR 18
This feels a bit hardcoded, but I think you always want to go 53 weeks back from the first day of the current week, so maybe =Date(today()-weekday(today())-(53*7))?
View solution in original post
Thanks Frank_Hartmann. That solution works this year because last year was a leap year, but next year it won't.I'd rather have an dynamic expression that takes that into account.
For example =WeekStart(MakeWeekDate(year('2022-01-10')-1,week('2022-01-10'),0)) will show '2021-01-11' rather than 2021-01-04
Great, thanks Chris - that does the trick!