Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Latest Date

Hi

I have a table which shows roster periods and when they were published.  I want to include something in the script which identifies the latest published date.  My table is below :

    

PK_DatePeriodPublish_DatePublished
01/12/201501/12/15 - 14/12/1501/11/2015Y
08/12/201501/12/15 - 14/12/1501/11/2015Y
15/12/201515/12/15 - 28/12/1515/11/2015Y
22/12/201515/12/15 - 28/12/1515/11/2015Y
29/12/201529/12/15 - 12/01/1629/11/2015N
05/01/201629/12/15 - 12/01/1629/11/2015N

I want to add a line in the script which does the following :

     

PK_DatePeriodPublish_DatePublishedLatest_Published
01/12/201501/12/15 - 14/12/1501/11/2015Y
08/12/201501/12/15 - 14/12/1501/11/2015Y
15/12/201515/12/15 - 28/12/1515/11/2015Y
22/12/201515/12/15 - 28/12/1515/11/2015YLatest Published
29/12/201529/12/15 - 12/01/1629/11/2015N
05/01/201629/12/15 - 12/01/1629/11/2015

N

Could anyone help ?

Thanks

Phil

1 Reply
rubenmarin

Hi Phil, after you have loaded your table you can add the text to the record using 'first' and 'order by', ie:

Data:

LOAD Yourdata...

FROM ...

Left Join(Data)

First 1 LOAD *, 'Latest Published' as Latest_Published resident Data where Published='Y' order by Publish_Date desc, PK_Date desc;