First off, here are my environment variables for weeks:
SET FirstWeekDay=6; SET BrokenWeeks=0;
This statement evaluates to '2', which is what I would expect:
With weeks starting Sunday, Jan 2nd was the start of the second week of the year. Now, if I feed this result into MakeWeekDate, like this:
It returns 1/16/2022 - it's off by 2 full weeks! I'm assuming what's going on is that the MakeWeekDate function does not pay attention to the environment variables, but I'm not positive. But my desired behavior would be for MakeWeekDate(2022,2,6) to know that week 2 started on Jan 2nd, and it should return the date of Sunday of that week, which is Jan 2nd.
Is there any way to get that behavior? I'm trying to think of a good kludge to get the job done...
Just to expand on my use case - I'm using Google Analytics data, which uses Sun-Sat weeks that are not broken. Google Analytics weeks look like this: '202202', with that representing Jan 2nd-8th, but I can't get Qlik to properly convert it into a date.