How to filter out and retain different duplicates in a column in Excel and do certain operations with it

assign Activity:
LHS: dictReport | Dictionary(of String,Int32)
RHS:

(From d in dtData.AsEnumerable
Let dp = DateTime.ParseExact(d("Judge Date").toString.Trim, "yyyy-MM-dd HH:mm", System.Globalization.CultureInfo.InvariantCulture)
Group d by k=dp.Date into grp=Group
Let fc = grp.Where(Function (x) x("Result").toString.Trim.ToUpper.Equals("FAIL")).Count
Select t = Tuple.Create(k.toString("yyyy-MM-dd"), fc)).ToDictionary(Function (t) t.Item1,Function (t) t.Item2) 

We would assume that the date format after reading in the Excel within the datatable will be different. But You can check during a debugging and adapt as needed

2 Likes