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: 
n1ef5ng1
Creator
Creator

Sum Distinct *Attached file included

Hi gurus,

Due to data is not 'clean' enough, I experienced data that has these fields. Please see attached

Bus_ID act as as unique of individual bus

Bus Name is the name of the bus

Date is the date the bus starts it journey

Bus_Passenge is the amount of passenger the bus take

As you can see from the table, Bus_ID 411 and 800 have duplicate record. Due to the user wrong input on the Bus_ID, it count it as two recrods. Therefore when i try to find the total passenger, it added all even though it is suppose to be one record(400) for bus ID 411.

Is there anyway I can do the sum of the passenger by having one record for each bus _ID. It only takes in record that has the earliest date.

Thanks

Message was edited by: Bennn Bennn New file

10 Replies
tresesco
MVP
MVP

You missed the new attachment. If you meant the latest date, try :Sum(Aggr((FirstSortedValue(Bus_Passenger,-Date)),Bus_ID))

Note: a '-' symbol before Date changes the sort order.