How to filter and unfilter the data in data table

Hi I have an excel file 5 columns of data
my requirment is i want to filter the Tax column data which has $0.00 and $0.01 and calculate the sum of compare and Bill column and write the sum on total column and after the calculations i want to unfilter the data …i dont want any on the data to be removed…is this possible in UiPath

Attaching Sample file
InputFile.xlsx (8.8 KB)

@T_Y_Raju,

Use Invoke code activity and use below LINQ

dt.AsEnumerable().Where(Function(row) Not (row("Tax").ToString() = "$0.00" Or row("Tax").ToString() = "$0.01")).ToList().ForEach(Sub(row) row("Sum") = Convert.ToDecimal(row("Compare")) + Convert.ToDecimal(row("Bill")))

Thanks,
Ashok :slight_smile:

Getting this error

@T_Y_Raju,

Use this in Invoke Code activity.

Thanks,
Ashok :slight_smile:

@T_Y_Raju

Duplicate Post

@T_Y_Raju

You can use UiPath activities such as Filter Data Table to filter the TAX coulmn based on the specified criteria, and then use ExcelWriteRange activity to write the sum of the “Compare” and “Bill” columns to the “Total” column in the Excel file, use UnfilterDataTable activity to remove the filter applied earlier, also ensure that all the data is displayed.

HAPPY AUTOMATION!!

I dont see any unfilter datatable activity

@T_Y_Raju

For some studio versions yo may not find it.
Instead you can try this after filtering the data table
dtRestored = dtOriginal.Copy()

HAPPY AUTOMATION!!