Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
danshanahan
Contributor
Contributor

Distinct Counts on Updated Data

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:

updatedIDcompliant
7/12/20200010
7/12/20200020
7/12/20200030
7/12/20200040
7/12/20200051
7/13/20200011
7/13/20200021
7/14/20200041
7/14/20200050

 

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!

Labels (2)
1 Solution

Accepted Solutions
Kushal_Chawda

try below

=sum(aggr(if(updated=max(total<ID>updated),compliant),ID,updated))

View solution in original post

3 Replies
Kushal_Chawda

Your count looks to be correct as there is only two instances of latest data

danshanahan
Contributor
Contributor
Author

What I'm really trying to calculate is "for each ID, find the most recent entry (for that ID) then add the compliant field".

Kushal_Chawda

try below

=sum(aggr(if(updated=max(total<ID>updated),compliant),ID,updated))