Discussion Board for collaboration on QlikView Scripting.
I've was using the week() function, but that function returns me the week number of the year.
But I've need the monthly week number.
I don't need the complete week, can be incomplete.
Any suggestions ?
Go to Solution.
if(month(weekend(data))= month(data),div(day(WeekEnd(data)),7),div(day(Weekend(data,-1)),7)+1)+1 as WeekNumber,
maybe you can use:
=week(date) - week(monthstart(date)) + 1
= week(date) - week(monthend(addmonths(date,-1)))
Just tried this and it shows that 1st July 2013 is in week 2, yet it is actually week 1.
Could you clarify.
Had to use this to make it correct .....
if((week(Date) - week(monthstart(Date)) + 1)<1,1,(week(Date) - week(monthstart(Date)) + 1)) as WeekNumberInMonth,