Announcements
cancel
Showing results for
Did you mean:
Specialist

## how to get min date when a fiscal year or fiscal year pluse quarter is selected

Hello All,

From the above sample data for a particular material ,when either a fiscal year(2017) or fiscal year pulse quarter one(Q1) is selected i need to bring PRICE_MAT =1.75(VALIDFROM=4/2/2016)  and

If Fiscal year and Quarter Three(Q3) is selected then i need to bring PRICE_MAT=1.8 which is having max VALIDTO(12/31/9999) for that particular material ...

How to write a expression to achieve the above requirement ,any suggestions please

Thanks

4 Replies
Partner - Master III

Try

Sum({ <VALIDFROM = {"\$(=Max(VALIDFROM))"}>}PRICE_MAT)

Specialist
Author

Thanks for your reply ,but the above expression wont full fill my requirement ...

How do you calculate fiscal_year and Qurter??

Try below

Sum({ <VALIDFROM = {"\$(=Min(VALIDFROM))"},VALIDTO = {"\$(=Max(VALIDTO ))"}>}PRICE_MAT)

regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Specialist
Author

HI,Fiscal year i am getting from data source itself ,for quarter i wrote this

If(Right(CALMONTH,2)>=04 and Right(CALMONTH,2)<=06,'Q1',

If(Right(CALMONTH,2)>=07 and Right(CALMONTH,2)<=09,'Q2',

If(Right(CALMONTH,2)>=10 and Right(CALMONTH,2)<=12,'Q3','Q4'))) as QUARTER,

Community Browser