Filter data table keeping only one data from the duplicates

I have a data table consisting of two columns: “Name” and “Attendance.” For example:
image

this table may contain duplicate names.

In this case, I need to filter the table so that if duplicate entries are found, only the one marked as “Present” is kept. Additionally, it is important to retain all other related data.
A table displays the attendance status of three individuals: Alexis (NA), Jose (Present), and Demian (On way). (Captioned by AI)

image

image

image

(From d In dtTest.AsEnumerable
Group d By d("Name").ToString.Trim.ToLower Into grp = Group
From r In grp Where r("Attendance").ToString.Trim.ToLower <> "absent"
Select r
).CopyToDataTable

image

Obviously, if you have the data in an Excel file read that into a datatable instead of building one.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.