I want to filter the column of “Industry” and need to write it into different Sheets.
For Example, I want the particular Revit family Name type “1”and"2" and write it into a new Sheet name (with the family name).
I used the Filtered data table Activity but when i run the program the two sheets are empty. I wil attach the sample file can anyone help me on it.thanks Main.xaml (12.0 KB) Split.xlsx (16.9 KB)
→ Use Read range workbook activity to read the excel and store in a datatable called Input_dt.
→ Use assign activity to filter the Revit family Name with 1 by using LINQ Expression.
- Assign -> DT1 = (From row In Input_dt
Where row("RevitFamily Name").toString.Equals("1")
Select row
).Copytodatatable()
→ Use assign activity to filter the Revit family Name with 2 by using LINQ Expression.
- Assign -> DT2 = (From row In Input_dt
Where row("RevitFamily Name").toString.Equals("2")
Select row
).Copytodatatable()
→ Use write range workbook activity to write the DT1 in Sheet name 1.
→ Use another write range workbook activity to write the DT2 in Sheet name 2 in same excel.
Check the below workflow for better understanding, Regex_Practice.xaml (20.3 KB)
In the RHS of filter data table you have to use CDbl(CurrentRow(0).ToString.Trim). Because the table column RevitFamily Name is of type Double.
In the Write Range workbook activity you wrote CurrentRow.toString which would create only one sheet System.Datarow something like this. You have to Write CurrentRow(0).toString to write 2 and 1 in sheet names.