Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Bilal3
Contributor
Contributor

Filter a table

Hello community,

 

In my following Qliks ense table, I want to display only the green lines (latest date for each Ref) 

Bilal3_0-1683721101582.png

 

Would you please support ? 

 

Labels (7)
2 Replies
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi @Bilal3 

First you need to flag each of the latest rows. To do this create a unique key of Ref and Date in the load of the table:

Table:
LOAD
    Ref & Date(Date, 'YYYYMMDD') as RowID,
    Ref,
    Date,
    ...

 

Then once you have the key  you can pull out just the latest RowID per Ref in a separate table:

Latest:
LOAD
   maxstring(RowID) as RowID,
   1 as IsLatest
RESIDENT Table
GROUP BY Ref;

 

You can then use the IsLatest field in set analysis in the measures in your table, e.g.

sum({<IsLatest*={1}>}Value)

I notice one of your dates is malformed in your screenshot, the above will only work if you have correct dates in  your data.

Hope that helps.

Steve

 

BrunPierre
Partner - Master II
Partner - Master II

Hi, from the back end you could do this.

Data:
LOAD Ref,
     Date,
     In,
     Out,
     Name
FROM SourceTable;

Inner Join
LOAD Ref,
     Date(Max(Date)) as Date

Resident Data;