I have a question about filtering process.
I have an example excel and I want to get yellow marked rows inside of this DT.
example.xlsx (8.2 KB)
I use this formula but it doesnt work.
(From p in DT.Select() where( From q in DT.Select() where q(“Column4”).Equals(p(“Column4”)) and q(“Column5”).Equals(p(“Column5”)) Select q).ToArray.Count>1 Select p).ToArray.CopyToDataTable()
How to filter out yellow marked rows?
Have You tried with Filter DataTable activity
Check out the docs
Your LINQ Expression is working good
Check out the XAML file
FilterDtgetRows.xaml (6.1 KB)
It seems like your linq is working fine
Please share the screenshot of the error that you are getting as the linq is working as expected.
I got this error.
Assign: The source contains no DataRows.
But when I check my DT in watch panel, I show datarows.
The Linq query used converts the Filtered rows according to the condition directly to a Datatable using
.CopyToDatatable but in cases where the condition fails we do not have any filtered rows and hence we get the error as seen.
To handle that we already have a Tutorial Post on it, Do check it and let us know if you were able to make the necessary changes :
This FirstAid Tutorial will describe how a the source contains no DataRows EXCEPTION can be handled.
Let’s have a look at the following filter data table scenario:
Filter all rows on a particular Country Code like FR, UK, ES, UK…
Ensure that all CCode data column values are trimmed
Ensure that the Filter check is case insensitive
we can implement it e.g. with the help of a LINQ statement:
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.