Im using filter data table (filter wizard) to remove rows including the data of the present day (now.string) of the present month.
The point is: when the month starts,it removes not only the row with the current date, but also, all the headers (i’m putting add headers and also keep columns, in filter wizard , but same result it removes the headers too)
Can someone help and or explaiin another way to keep headers from removing all the data values of the rows in an excel?
Hi @Phito can you show some sample data from it (Headers, datarow samples)?
i’m putting add headers
on your data readin activity, right?
Other Option could be: Assign Activity and
- Select Statement
- LINQ Statement
example filter rows 20190902.xlsx (8.1 KB)
Sure, there is an example. As i said, im using filter data, but i dont want to remove headers. The point is the filter removes everything if my filter has the condition to remove the values from the current day and that day is the first of the current month.
Pd: how can i use those select and linq statements in that?
Ok let me check need some mins for this
Use an Assign Activity
Value: YourDataTableVariable.AsEnumerable.Where(function (row) not row(0).ToString.Trim.Equals(DateTime.Now.toString(“dd-MM-yyyy”))).CopyToDataTable
In Case Of all rows are filtered out, then an exception will be thrown.
I Prepared this for you on LINQ to be faster, later I will do a check on filtertable to see if I can replicate
Cannot replicate but attached a sample for you
DateDataFilter.xaml (8.8 KB)
I would suggest go for the LINQ option. In the sample I added some lines so if all is filtered out, an empty Datatable is returned.
DatatableVar.Clone is setting the Structure to another DataTable
May I ask you on feedback once you have incorporated in your implementation, Thanks
Ok, thank you so much, let me see if i can implement well this and i post later.
But for now i appreciate the help