Check how many unique pair values in a data table with condition

Hi, I want to check how many unique pairs of values in a data table with a condition to exclude pairs that exceed a certain value.
For example I have a table with 7 columns, I only want column 2 and 4 where column 4 contains a date and I will exclude the count of a unique pair if their date exceeds this amount.
So far I know that I can get the count using this expression but I want to know if there is a way to exclude counts where the date exceeds a predefined date:
DT.DefaultView.ToTable(True,‚ÄúDocument ID‚ÄĚ,‚ÄúDocument Date‚ÄĚ).Rows.Count

Hi,

Perhaps you should exclude unwanted rows using LINQ where method, select method or FIlterDatatable activity in advance.

The following is a sample of LINQ

DT.AsEnumerable.Where(function(r) DateTime.Parse( r("Date").toString())<targetDate).CopyToDataTable().DefaultView.ToTable(True,‚ÄúDocument ID‚ÄĚ,‚ÄúDocument Date‚ÄĚ).Rows.Count

Regards,

2 Likes