Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Qlik team!
I'm struggling with a visualization issue that I could use some help with. I have a set of data which is updated occasionally. When this new data is updated, a new row is added to my table with the updated information (we're only appending the changed information). I'm looking for a way to tell a Qlik KPI visualization to only count a field when the row is the most recent data for an ID.
My data:
updated | ID | compliant |
7/12/2020 | 001 | 0 |
7/12/2020 | 002 | 0 |
7/12/2020 | 003 | 0 |
7/12/2020 | 004 | 0 |
7/12/2020 | 005 | 1 |
7/13/2020 | 001 | 1 |
7/13/2020 | 002 | 1 |
7/14/2020 | 004 | 1 |
7/14/2020 | 005 | 0 |
I've tried: sum({<updated={"$(=Max(updated.autoCalendar.Date))"}>}compliant) but this returns 2. In this example I'm looking for the result to be 3.
Any thoughts?
Thanks!
try below
=sum(aggr(if(updated=max(total<ID>updated),compliant),ID,updated))
Your count looks to be correct as there is only two instances of latest data
What I'm really trying to calculate is "for each ID, find the most recent entry (for that ID) then add the compliant field".
try below
=sum(aggr(if(updated=max(total<ID>updated),compliant),ID,updated))