Filter out certain values in data

Hello All,

In the below table I want filter out (remove) the values containing “900” using filter datatable.

image

Please help with the solution,

Working with DataTables:

  • Filter DataTable Activity: COndition - Not endsWith: “900”

OR

LINQ:
Assign Activity:
dtFiltered =

dtData.AsEnumerable.Where(Function (x) Not x("Number").toString.Trim.EndsWith("900")).CopyToDataTable

Handling empty results

EDITED: fixed with NOT from keeping to removing

Hi @Yugal_Raju

Hi @Yugal_Raju

→ Read Range Workbook
image
Output-> dt
→ Use below syntax in Assign:

dt_Output = (From row In dt.AsEnumerable()
                     Where Not row.ItemArray.Any(Function(item) item.ToString().Contains("900"))
                     Select row).CopyToDataTable()

dt_Output is of DataType System.Data.DataTable
→ Write Range Workbook dt_Output
image

Hope it helps!!

Hi @Yugal_Raju

→ Read Range Workbook
image
Output-> dt
→ Filter DataTable


→ Write Range Workbook dt_Output
image

Hope it helps!!

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