Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

philmywallet
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

Tags (1)
1 Reply
rubenmarin
Not applicable

Re: Latest Date

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;