Not able to filter using linq

Hi @kumar.varun2 ,

I am not able to filter the Pivot table, I am not getting any error but data was not filtering.

image

I just want to filter with column 3 .

and i have use those records in to another excel .

I am using the below query to filter.
pivotAfteraddcolumnDT.AsEnumerable.Where(Function(r) r.Item(“NewCustomers”).ToString=“New”).CopyToDataTable

Regards,
surya

Share the excel file

@kumar.varun2 , due to security reasons I am not able to attach the file.

Column A and Column B is a pivot table. Column C is not a Pivot table which is added for new customer using excel formula.

Please help me why i am getting this error.

suryateja,
Thanks in advance

@Surya2

try this

pivotAfteraddcolumnDT.AsEnumerable.Where(Function(r) r.Item("NewCustomers").ToString.Equals("New")).CopyToDataTable

Ya i am not able to see the changes, can we redirect to the same file to see the changes using write range ?

Try to write in other sheet first. Also make use of debugging the code and looking at the value of variables in local pane.

Sure Thanks for Your time, i will try

@kumar.varun2
How can we write this filtered records to another excel?

letsay i am having 566rows i have to insert from 500 rows how can i do it?

May be add a Trim before comparing.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.