Filter Data is not working

This is my main excel sheet data and i want to extract the data which only contains status=pending into another sheet


This is my workflow …

image
But its not working properly i dont know why, its showing me only headers not the data

Hi @NervousTuber

Please use the below Method.

Dt.select("[Status] =‘Pending’").CopyToDataTable

Regards

where to pass this method? inside filter data table?

@NervousTuber

  1. Instead of Filter datatable.
    2)create a variable type of datatable
  2. then assign the method to the new datatable variable
  3. Write range the new filtered datatable.

Regards

readDT = the Variable Name of our DT form the Read Range Activity :wink:

alternativ kannst du die Filter-Activity verwenden und im Wizard dann einstellen:

Matching Rows: “Keep”
Column 7 - Contains - “Pending”

Und bei den Spalten gehst du auf:
“Keep”
und fügst 8 Spalten (0-7) hinzu

Sollte auch gehen


Yeah i already did that still not working…

Hi @NervousTuber ,
Try this
dt.AsEnumerable().Where(function(x) x(“Status”)= ‘Pending’).ToList.CopyToDatatable

…ups … okay :innocent:

see upper reply after edit :slight_smile:

have you checkt in debug mode that the dt is filled?

not working

Can you send me that excel?

Also please make sure spaces are not their in ‘Pending’ value while running any filter method.
Try to use contain instead of equal.

@NervousTuber

here is a little picture gallery for you. maybe it helps

image

image

1 Like


thanks for your help guys :slight_smile:
issue got resolved

1 Like

@ermanoj3101

I have modefied your Input to
testDT.AsEnumerable().Where(function(x) x.Item(3).Equals(“Pending”)).CopyToDataTable()

alternative i tryed …x(“Status”).Equals… its working too.

1 Like

Thanks @MarioHerrmann but i am still wondering why it worked with column number instead of column name, Is he is not selecting headers through read range so what the default headers get created

@ermanoj3101
Misunderstanding. It works both only then the function call is a little different.

With heading: x(“Status”).equals(“Pending”)
With number: x.item(3).equals(“Pending”)

I think the call by name or by index depends if the number of columns is not fixed yet but the label is :slight_smile:

What is more important the chicken or the egg … you understand what I mean :wink:

Got it :grinning:

1 Like

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