Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ioannagr
Creator III
Creator III

get max(date) from selected dates in date picker

Hello all.

Let's say I have a date picker in the UI and the user selects either one random date or a random date range.

What I want to do is to everytime be able to work with that random max(selecteddate)  and compare it to the max(donationdate) the person ever did.

 

How could I solve this?

 

Many thanks.

11 Replies
Anil_Babu_Samineni

What you are after? Once comparison done what you want?

If(Max(selecteddate)=max(donationdate), 'Matched', 'Non Matched')

Or

If(Max(selecteddate)=max({1}donationdate), 'Matched', 'Non Matched')

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
ioannagr
Creator III
Creator III
Author

I have blooddonors in the data set  and the question is, did they donate blood again after that certain date (or date range) the user picks ?

 

 

 

ioannagr
Creator III
Creator III
Author

Sorry, my bad, I don't have a variable called "selecteddate". With that I meant the random date a user picks in the date rang picker, in the UI.

Anil_Babu_Samineni

you can use Date picker field instead selecteddate?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
ioannagr
Creator III
Creator III
Author

Sure. 

But let's say this donor has indeed donated blood during 23/7/2017 - 23/08/2017 but he also has on  23/11/2017.

I want to make a filter pane called maybe "Has donations after this date" Yes/no.

For this i thought i could use the max date of this of these the user selected and compare it to the max donationdate of the donor(s). For this person I described the pane should show "Yes".

The donors are thousands and I'm only interested in how many of them have more later donations than the selected dates (that is they have returned to donate).

 

 

Anil_Babu_Samineni

Please Share your sample data set?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
ioannagr
Creator III
Creator III
Author

I am not allowed to. 😞

 

But i can describe it.

I have plenty of dates for every donor.

My client wants to be able to observe what is happening for the whole dataset at every date or date range possible.

So I set up this date range picker and they pick whatever they want as dates.

Their question is : Have these donors returned to donate after this date selection?

 

So i want something like count(distinct(donationdate)) after their selected dates or date range, so after the max date they pick.

Tell me how I can describe it better, if you need more clues.

Is there a way or a function to get as input the max of the selected date in the ui?

 

 

Anil_Babu_Samineni

Perhaps this?

count({<donationdate={"=(Max(Date)>=Max(donationdate)) and (Max(Date)<=Max({1} donationdate))"}>} distinct donationdate)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
ioannagr
Creator III
Creator III
Author

with max(Date) is it working with user input?

 

😁