Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Community,
My issue is that the qlikview default week is Monday-Sunday , and i need the weeks to be starting from Saturday-Friday.
for example , if i select 2013, week 30 in my calender i would want to see the dates form 20th - 26th June.
i tried by using
If(WeekDay(Date) = 6, Week(Date) +1, Week(Date)) AS NewWeek,
but i'm getting weekstart from Sunday-Saturday.
but i need from saturday to friday.
i'm attaching the sample apps kindly find the attachment.
thanks,
Mukram.
Hi,
Try this.
Let vMin = num(MakeDate(2012,01,01));
Let vMax = num(MakeDate(2012,12,21));
Load Date($(vMin) + RowNo() -1) as DATE,
WeekDay(Date($(vMin) + RowNo() -1)) as WEEKDAY,
if(num(WeekDay(Date($(vMin) + RowNo() -1)))>=4,num(WeekDay(Date($(vMin) + RowNo() -1)))-3 ,
NUm(WeekDay(Date($(vMin) + RowNo() -1)))+4) as WEEK_NUM
AutoGenerate 1
while Date($(vMin) + RowNo() -1) < Date($(vMax));
Regards,
Kaushik Solanki
Dear kaushik Solanki,
thanks for Quick response.
But from your solutions still i'm getting the result which i'm expecting.
when i select the Week 30 then it's selected 07/22/2013 to 07/28/2013.
i need the dates from 07/20/2013 to 07/26/2013.
Thanks,
Mukram.
Try this.
Let vMin = num(MakeDate(2013,01,01));
Let vMax = num(MakeDate(2013,12,21));
Load Date($(vMin) + RowNo() -1) as DATE,
if(num(Weekday(Date($(vMin) + RowNo() -1)))>=5,Week(Date($(vMin) + RowNo() -1))+1,Week(Date($(vMin) + RowNo() -1))) as WEEK
AutoGenerate 1
while Date($(vMin) + RowNo() -1) < Date($(vMax));
Regards,
Kaushik Solanki
Dear kaushik Solanki,
Thanks for your help.
i make small change in script it's working as per my requirement.
Like
If(WeekDay(Date) >= 5, Week(Date) +1, Week(Date)) AS NewWeek,
Thanks,
Mukram.
Its cool.
Regards,
Kaushik Solanki