Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Gowtham174
Creator
Creator

Week start and end date display

Hi all,

I need to display the week start date and end date when I filter for week, i.e max week should display and along with start date and end date of that week. similarly when i filter for other weeks also particular start date and end date of that week.

start date and end date i need to display in text box, below is the week start date for my week51.

2018-06-15,

16,

17,

18,

19,

20,

2018-16-21

Thanks,

Gowtham

4 Replies
bwisealiahmad
Partner - Specialist
Partner - Specialist

Hi,

Look into the functions for this named:

WeekStart() - https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/DateAndTimeFun...

WeekEnd() - https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/DateAndTimeFun...

That should help you out

You can use Date() formatting on that and change to 'YYYY-MM-DD' or however you want it.

Date(WeekStart(Max(Date)),'YYYY-MM-DD')

gives per say:

Capture.PNG

In a data model where the highest date I chose was 26.06.2017 and I changed the formatting.

Best,

Ali A

sewialwork
Partner - Contributor III
Partner - Contributor III

You can create addition field in your script:

date(WeekStart([Date]),'YYYY-MM-DD')&' - '&Date(WeekEnd([Date]),'YYYY-MM-DD') as [Weekname],

Then you can either use this field instead of your old week field or show it`s value in the text box with some condition like if(Getselectedcount(Week)=1,1,0).

For the textbox like:

2018-06-15,

16,

17,

18,

19,

20,

2018-16-21  - try this expression

if(Getselectedcount(Week)=1,weekstart(Date)& ,

&day(weekstart(Date,0,1))& ,

&day(weekstart(Date,0,2))& ,

&day(weekstart(Date,0,3))& ,

&day(weekstart(Date,0,4))& ,

&day(weekstart(Date,0,5))& ,

&weekend(Date),0)


Hope this will help)

AGB

balabhaskarqlik

Try this in your text box:

=Week(DATE(floor([Active Date]), 'YYYY-MM-DD')) &': '& Weekstart (DATE(floor([Active Date]), 'YYYY-MM-DD')) & ' to '& Weekend(DATE(floor([Active Date]), 'YYYY-MM-DD'))

balabhaskarqlik

Also, Try this in text box:

Dual(Weekstart(Date)&'-'&Weekend(Date),week(Date))