Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
samuel_brierley
Creator
Creator

button formula not quite working


Hi all,

first of all thanks for any help on this, iu have the following formula that is supposed to say if the date is a fri skip to next monday if not move to next day. i think my formula is logical however the skip to monday part doesnt work.

if(Date(Date,'DDD')= 'Fri', Date(Date+3),Date(Date+1))

thanks for any help

1 Solution

Accepted Solutions
Not applicable

Hi Samuel

I agree with Massimo in that

If(Weekday(Date)=4,Date(Date+3,'DD/MM/YYYY'),Date(Date+1,'DD/MM/YYYY'))

will return the date of the following Monday if the Date is a Friday or the date of the next day if Date is not a Friday.

Sample results are:

Sample Results.png

Kind regards

Steve



View solution in original post

6 Replies
Anonymous
Not applicable

try using Day instead of of the first Date  :

if(Day(Date,'DDD')= 'Fri', Date(Date+3),Date(Date+1))

michael_maeuser
Partner Ambassador
Partner Ambassador

hi,

if(WeekDay(Today())='Fri', date(Today()+3), date(Today()+1))

samuel_brierley
Creator
Creator
Author

Hi this is getting the same result as i was getting,

i think the reason for this is because i dont actually have any data for saturday or sunday,mayb knowing this would help.

preminqlik
Specialist II
Specialist II

use max(Date) like below

if(Date(max(Date),'DDD')= 'Fri', Date(max(Date)+3),Date(max(Date)+1))

maxgro
MVP
MVP

=if(WeekDay(Date)=4, ...,  ...)

Not applicable

Hi Samuel

I agree with Massimo in that

If(Weekday(Date)=4,Date(Date+3,'DD/MM/YYYY'),Date(Date+1,'DD/MM/YYYY'))

will return the date of the following Monday if the Date is a Friday or the date of the next day if Date is not a Friday.

Sample results are:

Sample Results.png

Kind regards

Steve