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: 
Anonymous
Not applicable

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
swuehl
MVP
MVP

Try something like

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

to calculate your last day of the working week.

View solution in original post

1 Reply
swuehl
MVP
MVP

Try something like

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

to calculate your last day of the working week.