# QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
CUSTOMERS ONLY: Now accepting customer applications for the 2023 Luminary Program: SUBMIT NOW
cancel
Showing results for
Did you mean:
Creator

## WeekNum required as w1,w2,w3,w4..Week Starts From Tuesday to Monday.

 tue wed thu fri sat sun mon weeknum 25-04-2017 26-04-2017 27-04-2017 28-04-2017 29-04-2017 30-04-2017 01-05-2017 w1 02-05-2017 03-05-2017 04-05-2017 05-05-2017 06-05-2017 07-05-2017 08-05-2017 w2 09-05-2017 10-05-2017 11-05-2017 12-05-2017 13-05-2017 14-05-2017 15-05-2017 w3 16-05-2017 17-05-2017 18-05-2017 19-05-2017 20-05-2017 21-05-2017 22-05-2017 w4 23-05-2017 24-05-2017 25-05-2017 26-05-2017 27-05-2017 28-05-2017 29-05-2017 w5 30-05-2017 31-05-2017 01-06-2017 02-06-2017 03-06-2017 04-06-2017 05-06-2017 w1
1 Solution

Accepted Solutions
Master II

Hi,

Try to use HIC suggestion (redefine week num)

Set vCal_FD = 1; // First Day of the week {0=Mon, 1=Tue, ... , 6=Sun}

Set vCal_BW = 0; // Broken Weeks allowed {0=No, 1=Yes}

Set vCal_RD = 4; // Reference day = This day in Jan defines week one {1..7}

Div( Date - WeekStart( WeekYearRefDate, 0, \$(vCal_FD) ) + 7, 7 ) as WeekNumber,

Year( WeekYearRefDate ) as WeekYear;

Date( YearStart( If( \$(vCal_BW), Date, WeekRefDate )) + \$(vCal_RD) - 1) as WeekYearRefDate ;

Date( WeekStart( Date, 1, \$(vCal_FD) ) - \$(vCal_RD) ) as WeekRefDate ;

Redefining the Week Numbers

Master II

Hi,

Try to use HIC suggestion (redefine week num)

Set vCal_FD = 1; // First Day of the week {0=Mon, 1=Tue, ... , 6=Sun}

Set vCal_BW = 0; // Broken Weeks allowed {0=No, 1=Yes}

Set vCal_RD = 4; // Reference day = This day in Jan defines week one {1..7}

Div( Date - WeekStart( WeekYearRefDate, 0, \$(vCal_FD) ) + 7, 7 ) as WeekNumber,

Year( WeekYearRefDate ) as WeekYear;