1 Reply Latest reply: Nov 19, 2012 7:47 AM by Stefan Wühl RSS

    Week end code

    Paul Wonford

      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?