I want to filter the excel using the multiple condition using the filter data table activity.
But I am not getting that when to use the or and operators.
Can someone help at what scenarios I need to use OR AND operators.
if I want filter more than 5 columns.
Use the AND operator when you want to filter rows that meet all specified conditions. All conditions must be true for a row to be included in the filtered result.
Use the OR operator when you want to filter rows that meet any of the specified conditions. A row will be included if at least one condition is true.
But it would be preferable to use the Linq query rather than using the filter data table activities.
(From d in dtData.AsEnumerable
Let v1 = d(0).ToString.Trim
Let v2 = CDbl(d("Amount").ToString().Trim)
Let v3 = d("ByPassInfo").toString.Trim
Where v1.Equals("Prio1") And (v2 < 250 Or v3.Equals("Yes"))
Select r = d).CopyToDataTable
SampleDummyData.xlsx (14.0 KB)
The purpose of the filtering is that in an input excel if any empty/null row values are present then need to remove that before adding to the queue.
For reference I attached the excel sample file, in that excel actually only 3 records are present, but when I check the row count it has showing output as 13 rows, so instead of adding 3 rows to the queue, it getting added 13 queues item.
(From d in dtData.AsEnumerable
chk = d.ItemArray.any(Function (x) isNothing(x) OrElse String.IsNullOrEmpty(x.toString.Trim))
Where not chk
Select r = d).CopyToDataTable