Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

ashishpalkar
Contributor II

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

Re: Find max date and min date from selected dates

Max( [OrderDate] , 2)


-Rob

15 Replies

Re: Find max date and min date from selected dates

Would simply using

Min ( [OrderDate] )

and

Max( [OrderDate] )


suffice ?

ashishpalkar
Contributor II

Re: Find max date and min date from selected dates

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

Re: Find max date and min date from selected dates

Max( [OrderDate] , 2)


-Rob

ashishpalkar
Contributor II

Re: Find max date and min date from selected dates

Hi Rob

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

MVP
MVP

Re: Find max date and min date from selected dates

May be try this

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

ashishpalkar
Contributor II

Re: Find max date and min date from selected dates

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

MVP
MVP

Re: Find max date and min date from selected dates

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
Contributor II

Re: Find max date and min date from selected dates

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

Please find attached image.

MVP
MVP

Re: Find max date and min date from selected dates

Try this

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