Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Week selection with different week start date

I needed my week to start on a Saturday and end on a Friday.  Meaning wk31 for me would start on Saturday 26/07/14 and end on Friday 01/08/14. 

To achieve this I have created a listbox with the below expression instead of a field.

=week(WeekStart(Date,0,-2))+1

Not sure if this was the proper way of doing it but it seems to work.

Now I need to create a button which when pressed select the last 12 weeks according to my week format starting on Saturdays and ending Friday's.

I tried the below but this is creating a rolling range day by day. 

='>=$(=date(today()-84))' & '<$(=date(today()))'

I need the range to start from Saturday of 13 weeks ago and end always Friday of last week.  Anyone can help me get this please?

4 Replies
ssanchez
Partner - Contributor III
Partner - Contributor III

Hi Alex,

In a similar case, I used a new field added to the master calendar in the load script. For each possible date, sorted in ascending order, I added a week personnel identifier value which is incremented for each starting day of week found (Saturday).

The new field can be selected from a button which selects date as possible values ​​of the period of week (Saturday-Friday) or weeks required. The attachment shows an example.

nagaiank
Specialist III
Specialist III

To arrive at the week start date (of Saturday-to-Friday week) for any Date, use the following expression:

Date(WeekStart(Date+2)-2)

ashfaq_haseeb
Champion III
Champion III

Hi,

try below

If(WeekDay(Date) >= 5, Week(Date) +1, Week(Date)) AS NewWeek,

Regards

AHFAQ

Not applicable
Author

Hi,

You may try this

>=date((WeekStart(today(),-13)-2),'DD/MM/YYYY')   <= date(WeekStart(today())-3,'DD/MM/YYYY')