Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
juanpv20
Contributor II
Contributor II

count latests records

Hi

I have theses fields

serial_cve: the serial number of our devices

fec_commServ: the date a message arrive to our server

EV2OFC_OTA_Reason_General_P1081: the status we want to count

We want to count how many latest status we have

I just could calculate the latest status for each serial using:

firstsortedvalue(EV2OFC_OTA_Reason_General_P1081,-fec_commServ,1)

for the above function I used of course as dimension: serial_cve

Now I want to count the quantity of each status EV2OFC_OTA_Reason_General_P1081

for that I need to set as dimension : EV2OFC_OTA_Reason_General_P1081

then I have no idea how to count the latest ones:

I tried

count(firstsortedvalue(EV2OFC_OTA_Reason_General_P1081,-fec_commServ,1))

of course it looks wrong but I have no clue


thanks!!!!

3 Replies
swuehl
MVP
MVP

Try a calculated dimension:

=Aggr( firstsortedvalue(EV2OFC_OTA_Reason_General_P1081,-fec_commServ,1), serial_cve)

then as expression

=Count(DISTINCT serial_cve)

juanpv20
Contributor II
Contributor II
Author

thanks a lot! this worked very good!

swuehl
MVP
MVP

If your request is resolved, then please consider closing this thread by marking helpful and / or correct answers:

Qlik Community Tip: Marking Replies as Correct or Helpful