Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date Calendar Week start change

I have created a Master Calendar as below script; but I need to do the modification as I need Start of the week should be Thursday and end of the week should be Wednesday. but as per the script below it gives me Monday to Sunday week start and week end.

can we make change like this in Qlikvew ?

LET vDateMin = Num(MakeDate(1998,1,5));
LET vDateMax = Floor(YearEnd(AddMonths(Today(), 12)));
LET vDateToday = Num(Today());
TempCalendar:
LOAD
$(vDateMin) + RowNo() - 1 AS DateNumber,
Date($(vDateMin) + RowNo() - 1) AS TempDate
AUTOGENERATE 1
WHILE $(vDateMin)+IterNo()-1<= $(vDateMax);
MasterCalendar:
LOAD
TempDate AS Go_Live_Date__c,
Month(TempDate) AS CalendarMonth,
Year(TempDate) AS CalendarYear,
WeekStart(TempDate) AS WeekStart,
WeekEnd(TempDate) AS WeekEnd,
Week(TempDate) AS Week,
Month(TempDate) & '-' & Year(TempDate) AS CalendarMonthAndYear
RESIDENT TempCalendar ORDER BY TempDate ASC;
DROP TABLE TempCalendar;


4 Replies
swuehl
MVP
MVP

Try

WeekStart(TempDate,0, 3) AS WeekStart,
WeekEnd(TempDate,0,3) AS WeekEnd,

sunny_talwar

Try this:

SET FirstWeekDay=3;

sunny_talwar

This would just fix the values for those two fields, wouldn't it be better to use the environmental variable to change the WeekStart day for the whole application?

swuehl
MVP
MVP

If you are using QV 11.20 or earlier, have a look at

Redefining the Week Numbers

Redefining the Week Start

For Sense or QV12:

Redefining the Week Start in Qlik Sense