Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Gopi_E
Creator II
Creator II

How to roll week period to one day

 

Hi All,

I have two fields like WeekNumber and Date.

Annotation.png

Here if I select week number 1 result is like above that means a week to start with Monday.

Now I have a requirement like, if I select weekNumber 1 the week should be starts with 02-01-2018 to 08-01-2018 like that. please give any suggestions. 

Thanks,

Gopi

 

1 Solution

Accepted Solutions
sunny_talwar

Did you try playing around with this?

image.png

View solution in original post

5 Replies
sunny_talwar

Gopi_E
Creator II
Creator II
Author

 

Thank you sunny,

your link is said to change the week starts name. But here my requirement is rolling one day, that means in the first-week result is between 1st Jan to 7th Jan, but I have to move that period like 2nd Jan to 8th Jan.

I used Week(Date+1) as WeekNumber.

above function works for me ...can you tell me any other way to do that.

Thanks in advance 

sunny_talwar

Did you try playing around with this?

image.png

jensmunnichs
Creator III
Creator III

As seen on the Qlik help page for the week() function, the second parameter can be used to change the day you want weeks to start on. So in your case (assuming you want your weeks to start on Tuesday):

Week(Date, 1) as WeekNumber

Gopi_E
Creator II
Creator II
Author

 

Yeah, sunny 

i tried this with some changes, WeekStart( Date-1, 0, $(vCal_FD) ) as WeekStart,

it works, 

thank you sunny.