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: 
rubenacampos
Contributor III
Contributor III

How to display the latest record only within a date range?

I have a data dimension "Period of Performance" for all my accounts that is expressed like "04/06/2016 - 09/30/2016".  How do I write an expression to only display the most recent period of performance on a table? 

2 Replies
OmarBenSalem

If I understand ur need:

 

go to the script and do as follow in the table where u have ur periode of performance field:

date(Date#( trim(subfield("Period of Performance",'-')),'MM/DD/YYYY'),'MM/DD/YYYY') as EndDate

Now, in ur sheet, create a table:

as dimension : Period Of Performance

As a measure:

sum({<EndDate={"$(=date(max(EndDate),'MM/DD/YYYY'))"}>}YourMeasure)

rubenacampos
Contributor III
Contributor III
Author

I have a data dimension "Period of Performance" for all my accounts that is expressed like "04/06/2016 - 09/30/2016".  How do I write an expression to only display the most recent period of performance on a table? Each account has multiple Periods of Performances (POP) for each account.  I want to display the latest POP.  For example, if I have :

04/06/2016 - 09/30/2016

09/30/2014 - 04/05/2016

08/16/2017 - 08/15/2018

I want to only show the latest one of the group, "08/16/2017 - 08/15/2018".

Thank you in advance!