Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

pzwonford
New Contributor II

Week end code

Hi guys. I've written the following piece of code which works fine in a Qlikview text box

=date(today()+if(weekday(today())='Mon','4',

 

if(weekday(today())='Tue','3',

 

if(weekday(today())='Thur','1',

 

if(weekday(today())='Fri','0',)))))

This piece of code tells me what date the last day of the current working week is. I'd like to include this in the main code of the qlikview document so i can refer to it and don't have to repeat it over and over again. I've tried the following

date(today()+if(weekday(today())='Mon','4', 

if(weekday(today())='Tue','3',

 

if(weekday(today())='Thur','1',

 

if(weekday(today())='Fri','0',))))) as [LastDay]

However this spits up an error.

Can anyone help me out?

1 Solution

Accepted Solutions
MVP
MVP

Re: Week end code

Try something like

      Date(floor(WeekEnd(today(),0,-2)))

to calculate your last day of the working week.

1 Reply
MVP
MVP

Re: Week end code

Try something like

      Date(floor(WeekEnd(today(),0,-2)))

to calculate your last day of the working week.

Community Browser