Skip to main content
Announcements
YOUR OPINION MATTERS! Please take the Qlik Experience survey you received via email. Survey ends June 14.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to get the most current date from a list.

Hi All,

If I have a list of dates, lets say they are the date of every sale that a location of a business made.  How would I display the number of days since the last sale?  I understand that if I only had one date I could just use =[Sale Date]-Today() but since there are multiple dates I would want the 'most current date' - today().

So how do I create an expression to pull the most current date based on the selections of the chart?  Like for instance if I had CT and NY selected I would want to subtract 4/5/2004 from today but if I only had MA selected I would want the expression to calculate 3/4/2005 from today. 

Hope this makes sense and I appreciate the help.

LocationSale Date
CT12/1/2000
NY1/2/2001
MA1/2/2001
CT4/5/2004
MA3/4/2005
1 Solution

Accepted Solutions
maxgro
MVP
MVP

today() - max([Sale Date])

View solution in original post

6 Replies
maxgro
MVP
MVP

today() - max([Sale Date])

MK_QSL
MVP
MVP

=Interval(Today() - Max([Sale Date]),'DD')

qlikmsg4u
Specialist
Specialist

Date(today()-Max([Sale Date]))

daniel_kusiak
Creator II
Creator II

=Today()-max([Sale Date])

Not applicable
Author

Hi,

Please go through the attachment.

Regards,

Jemimah

Not applicable
Author

Hi Jemimah,

Your DATEFORMAT in the script is :  DateFormat='DD/MM/YYYY';

but the INLINE has MM/DD/YYYY.

I think the results will not be correct if format does not the match.

Regards

Kosmas