How to filter multi condtion with multi column

assign activity:
LHS: Result | DataType: List(Of Datarow) =

(From d in dtData.AsEnumerable
Let hasKey = arrColSet.Any(Function (x) arrKeys.Any(Function (k) d(x).toString.Contains(k)))
Where not hasKey
Let isDist = arrColSet.Select(Function (x) d(x).toString.Trim).Distinct().Count = arrColSet.Length
Where isDist
Select r=d).ToList

then check within an if acitvity
Result.Count > 0
Then: dtResult = Result.CopyToDataTable
Else: dtResult = dtData.Clone

1 Like

just share some more details with us related to the loop over the data table. Maybe a different name for the looped data row is used

i not used any loop here, Can i used for loop

maybe this will help

then please share more details on what you have implemented so far, Thanks

EXcel cpt code.xaml (10.0 KB)

One more thing i want to add, how to add header in this

give a try on replacing row with d
Let isDist = arrColSet.Select(Function (x) d(x).toString.Trim).Distinct().Count = arrColSet.Length

image

image

ensure following pattern

done thankyou,
Can you guide me to the next step?

I want only CPT with values, we have to remove empty CPT,
after that, I have to paste in new excel with the header.

sorry but i get null value in result dt (finalDt)

hi please see the above issue.

Can you help me on this, i did not get any data here.

just go again through the posts and recap what was done. Especially check out the defensive approach for handling empty filter results.

dr prefix we use for data row
dt prefix we can use for data table

so just do a more clear variable naming in your implementation. In case of the issue is existing go for debugging the code and check the statements within the different options as presented here:
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum