I have a doubt and I would be glad if someone could help me.
I’m trying to filter a DataTable (Excel Sheet) that has a total of 5 columns, by one of the columns.
That column can have the values A,B or C. I only want to keep the rows with value A and B.
I tried the “Filter” Excel activity but when I do “Read Range” in that sheet after, despites the Filtering he still gets the other values with C in the Column…
dtOut.Select(([Your_Column] LIKE ‘A’ or [Your_Column] LIKE ‘B’ or [Your_Column] LIKE ‘C’))
This way you can aggregate rules inside rules. If you have “Your_Column2” and want to apply a filter in that too you can do that this way:
dtOut.Select(([Your_Column] LIKE ‘A’ or [Your_Column] LIKE ‘B’ or [Your_Column] LIKE ‘C’) AND [Your_Column2] LIKE ‘AAAA’ AND ([Your_Column3] LIKE ‘YY’ or [Your_Column3] LIKE ‘XX’))
A good pratice is aggregate the filters by columns. More readable.
instead of excel filter activity you can use read range to get the all the data(dtresult).
after that you can filter using select statement
dtresult=dtresult.select(“[columnname]<>‘C’”)