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: 
ashishpalkar
Creator III
Creator III

Find max date and min date from selected dates

Hi There

I have requirement to find Max Date and End Date from selected date range by users.

E.g. Please find attached screenshot.

Thanks for your help!!!

1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Max( [OrderDate] , 2)


-Rob

View solution in original post

15 Replies
Anonymous
Not applicable

Would simply using

Min ( [OrderDate] )

and

Max( [OrderDate] )


suffice ?

ashishpalkar
Creator III
Creator III
Author

Thanks Bill,

I have following scenario's

1. Find the max date from selected date and from that get the previous date of the max date.

e.g. available dates 

                          11/30//2017   

                          11/29//2017   

                           1/28//2017   

                           1/25//2017   

                           1/22//2017   

                           1/12//2017   


if user selects dates


                           1/28//2017    - max date based on selections

                           1/25//2017    - prev date based on selected max date

                           1/22//2017    - min date


Thanks for your help

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Max( [OrderDate] , 2)


-Rob

ashishpalkar
Creator III
Creator III
Author

Hi Rob

Thanks for updates, still dont see its working , please check the attachment.

sunny_talwar

May be try this

Date(Max(Floor(BusinessDate), 2))

ashishpalkar
Creator III
Creator III
Author

Yes , that's correct. It worked with Date(Max(Floor(BusinessDate), 2))
Thanks for updates Sunny.

sunny_talwar

It might help to fix your business date in the script as it appears to be a timestamp.... I would do something like this if you don't really need the time portion

Date(Floor(BusinessDate)) as BusinessDate

ashishpalkar
Creator III
Creator III
Author

I see one issue though , if we dont select 2 dates , the previous date is showing as blank .

Please find attached image.

sunny_talwar

Try this

Date(Max({<BusinessDate = {"$(='<=' & Max(BusinessDate))"}>} Floor(BusinessDate), 2))