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: 
kunkumnaveen
Specialist
Specialist

how to get min date

Hi All, Can any one suggestion me what i am missing in below expression....

                  sum(aggr(Min({<BVALIDFROM = {"$(=Date(Min(BVALIDFROM)))"}>}BPrice),p_Material,V_Code))

what i am trying to get is ,when a fiscal year is selected so i need to select min date from BVALIDFROM and if min date has more then one bprice then select min bprice value .

But by the above expression i am getting zero as out put ...

When i remove BVALIDFROM = {"$(=Date(Min(BVALIDFROM)))"} i am getting output

sum(aggr(Min(BPrice),p_Material,V_Code))


but the above expression is not a valid one because there is no guarantee  whether it will pick min date VALIDFROM or not ..

i strongly believe the error is in this BVALIDFROM = {"$(=Date(Min(BVALIDFROM)))"} am i missing

My BVALIDFROM format is

Capture.PNG

5 Replies
Anil_Babu_Samineni

Try this

sum(aggr(Min({<BVALIDFROM = {"$(=Date(Min(BVALIDFROM),'mm/dd/yyyy'))"}>}BPrice),p_Material,V_Code))

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
sunny_talwar

May be add the date format

BVALIDFROM = {"$(=Date(Min(BVALIDFROM), 'M/D/YYYY'))"}

sunny_talwar

mm is for minutes... you should really use MM for months Anil

Anil_Babu_Samineni

Noted !!

The reason, I am using mobile

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
its_anandrjs

Try this and what is the format of BVALIDFROM


BVALIDFROM = {"$(=Date(Min(BVALIDFROM)))"}