Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
i am facing one issue regarding week and month
i have fields like week number 1 to 52 and months december,january,February
so issue is : in january2017 we have 5 weeks. but i need to display 4 weeks only means
my week start is : Monday
so by below pic
25,26,27,28,29,30,31------ should be december 2016 week 4
29,30,31,1,2,3,4, ------------------- should be in week1 of feb
Friend, have you tried the weekyear function?
Chanty, Can you create dummy data please which illustrate the output. We are happy with Random dates too
Anyway, look here Recipe for a 4-4-5 Calendar
No its not working
Something like
if( month(weekend(date) > month(weekstart(date),month(weekend(date) ,month(weekstart(date) ) as month?
Depends on what logic you want really, but the 4-4-5 as mentioned above will probably do it
Hi sureshqv,
Can you create a excel file , what do you have and the expected output in other column?
You need a Broadcast calendar. See Calendars
HIC
thanks Henric.. i tried that script still its not working .it is not giving as i mentioned
Hi Setu,
PFA. !
Hi,
I changed the initial settings at the top of the script. The value of FirstWeekDay with 0 changed to 6
SET FirstWeekDay=6;
Script code
Dates:
LOAD
Date(Date('18.12.2016') + RecNo() - 1) as Period
autogenerate(Date(Today()) - Date('18.12.2016') + 1);
autoCalendar:
LOAD
Period,
Date(Period) as %Date,
WeekDay(Period) as DayWeek,
Week(Period) as NumberWeek
Resident Dates;
DROP Table Dates;
Result
It should be noted that I have Russian localization of QlikView and day of the week starts Monday, not Sunday. If this is the correct decision may be changed by one setting FirstWeekDay.
*********************************************************************************************************************************
You can even offer such variant with the start numeration weeks from the beginning of the year
SET FirstWeekDay=0;
Dates:
LOAD
Date(Date('18.12.2016') + RecNo() - 1) as Period
autogenerate(Date('31.12.2016') - Date('18.12.2016') + 1);
autoCalendar:
LOAD
Period,
Date(Period) as %Date,
WeekDay(Period) as DayWeek,
Week(Period) as NumberWeek
Resident Dates;
DROP Table Dates;
SET FirstWeekDay=6;
Dates:
LOAD
Date(Date('01.01.2017') + RecNo() - 1) as Period
autogenerate(Date(Today()) - Date('18.12.2016') + 1);
Concatenate(autoCalendar)
LOAD
Period,
Date(Period) as %Date,
WeekDay(Period) as DayWeek,
Week(Period) as NumberWeek
Resident Dates;
DROP Table Dates;
Regards,
Andrey