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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
rustyfishbones
Master II
Master II

Count Distinct numbers using FirstSortedValue

Hi All,

I am trying to do a count using the below expression

=AGGR(count ({<DataValue = {"True"}, ParameterChildName = {"SigPod_AirTest_1_Status.Test_Passed"}, EntryTimestamp = {'$(=MIN(EntryTimestamp))'}>} distinct [Serial Number]),EntryTimestamp)

The result returns 1

should I be using FirstSortedValue in the Set Expression

I am trying to count the number of Serial Numbers where the Data Value is True and the ParameterChildName = SigPod_AirTest_1_Status.Test_Passed and I want to only count the Serial Numbers for the first Entrytimestamp as there can be multiple.


I understand I can count the distinct Serial numbers using DataValue and ParameterChildname, but I need to inlude only the first instance of each EntryTimestamp.


I hope you can help


Al

12 Replies
rustyfishbones
Master II
Master II
Author

I think this maybe it

=Count({<DataValue = {"True"},ParameterChildName = {"SigPod_AirTest_1_Status.Test_Passed"}>} Aggr(FirstSortedValue(Distinct [Serial Number], EntryTimestamp), [Serial Number]))

but again, I need to double check my results.

Thanks for your help

sunny_talwar

Sorry, I might be repeating myself, but do you want the value of serial number or the count?

rustyfishbones
Master II
Master II
Author

The Count of the Serial Numbers.