Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Most recent date variable

Dear all,

i would like to set a variable defining the date closest to today. in my files i also have dates in the future, so max(date) won't work.

i am looking in the direction of minizing the delta between today() and the date field. can anyone help?

many thanks

Joris    

1 Solution

Accepted Solutions
tresesco
MVP
MVP

so you don't need future dates comparison, try this :

=FirstSortedValue(EffectiveDate, (If((Today()-EffectiveDate)>0,(Today()-EffectiveDate))))

View solution in original post

5 Replies
tresesco
MVP
MVP

Try this:

=FirstSortedValue(EffectiveDate, fabs(Today()-EffectiveDate))

jagan
Luminary Alumni
Luminary Alumni

Try like this

=Max({<DateFieldName={'<$(=Today()'}>} DateFieldName)

Make sure that date format is same in DateFieldName and Today().

Regards,

Jagan.

Not applicable
Author

thanks,

this already works, but includes dates in the future too. what can i do to show the closest date in the past?

many thanks!

joris

tresesco
MVP
MVP

so you don't need future dates comparison, try this :

=FirstSortedValue(EffectiveDate, (If((Today()-EffectiveDate)>0,(Today()-EffectiveDate))))

Not applicable
Author

great! works fine!

thanks