Hello!
My goal is to filter a datatable where at least one item in an array is contained in the datatable. I’m having trouble creating a long expression filtering for multiple arrays. The goal is to see all rows for which these conditions are met:
- Any item in Array1 is contained in ColumnA
- Any item in Array2 is contained in ColumnA
- Any item in Array3 is obtained in ColumnB
Array1: {1,2,3} - contained in ColumnA
Array2 {9,8,7} - also contained in ColumnA
Array3 {A,B,C} - contained ColumnB
I was able to filter the datatable with one of the arrays:
FilteredDt = OriginalDt.AsEnumerable.Where(function (x) Array1.Any(function(y) x(“ColumnA”).ToString.Contains(y))).CopyToDatatable