Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a variable vPrevBussday=date(today()-1), how do I work in Saturday and Sunday. If it is Monday or Sunday ot should still go back to Friday as PrevBusssday
May be this:
=If(WeekDay(Today()) = 'Mon', Date(Today() - 3),
If(WeekDay(Today()) = 'Sun', Date(Today() - 2), Date(Today() - 1)))
May be this:
=If(WeekDay(Today()) = 'Mon', Date(Today() - 3),
If(WeekDay(Today()) = 'Sun', Date(Today() - 2), Date(Today() - 1)))
Hi,
another solution could be something like:
Date(Today()+3-RangeMax(4,WeekDay(Today()-1)))
hope this helps
regards
Marco
Hi,
Simply use FirstWorkDate() for this
=If(WeekDay(Today()) = 'Sun' OR WeekDay(Today()) = 'Sat', firstworkdate (Today(), 1), firstworkdate (Today(), 2) )
From Qlikview Help file:
firstworkdate(end_date, no_of_workdays {, holiday} )
Returns the latest starting date to achieve number_of_workdays (Monday-Friday) ending no later than end_date taking into account any optionally listed holidays. End_date and holiday should be valid dates or timestamps.
Examples:
firstworkdate ('2007-03-01', 9) returns '2007-02-19'
firstworkdate ('2006-12-31', 8, '2006-12-25', '2006-12-26') returns '2006-12-18'
that surely seems to be easier.
thanks
regards
Marco
Thank you all,I tried 2 of these solutions and achieved what I needed
Please close your thread if your question is answered.
Thanks
Regards
Marco