Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
gerhardl
Creator II
Creator II

Start weeks on Sundays

Hi there,

There are a few discussions on this topic, but I was not yet able to apply the proposed solutions to my application.

I pull data from different extracts where our dates are in this formatL DD-MMM-YY.

So I usually start with this:

DATE(DATE#( left([Effective Date],11), 'DD-MMM-YY')) as [Effective Date]

Then I do the following to get the week:

if(week(DATE(DATE#( left([Effective Date],11), 'DD-MMM-YY')))='21','01] 27/06-03/07' as [Effective Week]

     The company I do these reports for start their financial year in July, so this is seen as their First Week of the year.

However, their weeks start on Sundays, not Mondays. So their actial first week is 26/06-02/07 (The 26th being a Sunday).

How do I get the weeks in QV to start on Sundays? So I need week 21 to be 26/06 to 02/07, not 27/06 to 03/07.

Please assist.

Thank you,

Gerhard

10 Replies
Not applicable

SET DayNames='Sun;Mon;Tue;Wed;Thu;Fri;Sat';

is similar to SET DayNames='q;w;e;r;t;y;u';

It is just to customize the language and not the real start of the week.

I tried this and it shows April 30th 2012 as Sunday though it is Monday

Check these out

LET vCYDate = Date(Today());

LET vCYWeekStart = WeekStart(vCYDate,0,-1);

LET vCYWeekNo = Week(vCYWeekStart);

LET vPYWeekDay = MakeWeekDate(Year(vCYDate)-1,vCYWeekNo, vCYWeekDay);

LET vPYWeekStart = WeekStart(vPYWeekDay,0,-1);

LET vPYWeekNo = Week(vPYWeekStart);

Try using WEEKNUM(<Date>) in Excel for both these dates.

Actually the WeekStart shows Sunday but the Week number of that date is showing 1 week less than the correct week # as the vCYWeekStart / vPYWeekStart is considered as the last day of the previous week in QlikView.

How to globally set in QV to make Sunday as the start of the week?