Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Minimum of date

Hello, I would like to calculate from a date variable  "vDateDébut"  the smallest date

like this


smallest.JPG


i tried two formula but it doesn't work

min({<Date={"<$(=vDateDébut)"}>   Date)

min({<Date={"<$(vDateDébut)"}>   Date)

thank you for your help

1 Solution

Accepted Solutions
jmvilaplanap
Specialist
Specialist

Hi, I have an example

The expresion is like this: =date(min({<Date={"<$(=vDateDébut)"}>}Date), 'DD/MM/YYYY')

And I changed your variable to date format

Capture.PNG

And it works

P.S. QV is Case Sensitive, be careful with the field names, your field is named "Date" not "date"

View solution in original post

19 Replies
Anonymous
Not applicable
Author

please upload a sample...

prma7799
Master III
Master III

what expression you used for vDateDébut


Or please share sample app

tresesco
MVP
MVP

How is your variable defined? Try with a parenthesis correction, like:      

min({<Date={"<$(vDateDébut)"}>}  Date)

arvind_patil
Partner - Specialist III
Partner - Specialist III

Hi Saoud,

You Can try this;

 

Temp: 

Load 

               min(VALIDDATE) as minDate

             

Resident Facts; 

 

Let vDateDébut= Num(Peek('minDate', 0, 'Temp')); 

DROP Table Temp; 

jmvilaplanap
Specialist
Specialist

Hi

I think,this is the expression that you need:

  • date(min({<date={"<$(=vDateDebut)"}>}date), 'DD/MM/YYYY')

But, be careful with the vDateDebut data format, I define the variable as:

  • LET vDateDebut = date('03/01/2017', 'DD/MM/YYYY');

Because if not, the result of the first expression is null

Regards

Anonymous
Not applicable
Author

an example

thanks

Anonymous
Not applicable
Author

Hello,

Thanks but is dosesn't work, an example

Regards

Anonymous
Not applicable
Author

an example

thanks

Anil_Babu_Samineni

I don't have license !! What you are declaring with variable

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