Discussion Board for collaboration on QlikView Scripting.
can you give me a script on how to set
Jan 1 is always Week 1 every Year
Have you tried week function?
get the month start date from monthstart() and then subtract 7 days from that.
you can use
Div(date-YearStart(date)+WeekDay(YearStart(date))+7,7) as WeekNumber
This will always return week 1 for Jan 1st. It will use Monday as the first day of the week.
If you want Sunday as the first day of the week, you should use
Div(date-YearStart(date) + WeekDay(YearStart(date)+1) +7,7) as WeekNumber
=Right(LunarWeekName(MakeDate(2012, 1)), 2)
Hope it helps you.