Forum Discussion

Anthony_A's avatar
Anthony_A
Regular Visitor
2 years ago

Distinct count across multiple columns but looking for the latest date for the record

Hey Community, 

 

I have a data set that contains a list of stores and all of the health permits associated with it. The data also contains an issue start date and end date. 

 

I want to count the a distinct number of stores per certificate with latest start date. 

 

Example: 

Store Code: ABC123  Certificate Type: ServSafe Certificate Issue Start Date: 2/23/2024 Issue End Date: 2/23/2026

Store Code: ABC123  Certificate Type: ServSafe Helper Certificate Issue Start Date: 2/23/2024 Issue End Date: 2/23/2026

Store Code: ABC123  Certificate Type: ServSafe Certificate Issue Start Date: 2/23/2021 Issue End Date: 2/23/2024

 

Count should be 1 for ServSafe Certificate and 1 for ServSafe Helper Certificate.

 

Any guidance will be appreciated.

2 Replies