Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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
MVP
MVP

Re: Most recent date variable

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

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

5 Replies
MVP
MVP

Re: Most recent date variable

Try this:

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

MVP
MVP

Re: Most recent date variable

Try like this

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

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

Regards,

Jagan.

Not applicable

Re: Most recent date variable

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

MVP
MVP

Re: Most recent date variable

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

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

Not applicable

Re: Most recent date variable

great! works fine!

thanks    

Community Browser