Filter data table not working for two things?

I have data scraped a list of rankings, and I try to filter it to give me USA players with ranking less than 2700.

This above filter data works, it gives me the USA players if I try to print it out.

Then I try to filter the ranking, but then it just prints this:

This image shows a message box with the title "Message Box" and the content "Column-0, Column-1, Column-1, Url, Column-2, Column-3, Column-4, Column-5, Column-6" and an "OK" button. (Captioned by AI)

This is the my table data:

If someone can help, i would really really much appreciate it!!

Hi @Kalle77

Could you remove double quotes for “2700” value make it to 2700 and check

Thank you for helping me! But it didn’t fix it, still the same result in printing :frowning:

Change the “Column Name” to Column Index Value with 5

The image shows a filtering interface designed to keep rows where the value in column 5 is greater than or equal to 2700. (Captioned by AI)

Output your data table after extraction and see the headers, pls check if it’s coming as column 1,2etc and another row of actual header name and then the values. If this is the case you might need to remove the first row

Hi @Kalle77

While Extracting the table,Try by capturing from row1 not from the headers.
And then Wile filtering Remove “” from 2700

Regards

@Kalle77
Check the condition is greaterthan equal to
Then
Print values data table to string use outputdatatable activity

Remove " from value

Thank you! But it still prints the same.

This is what I get if I print text from the first filter data activity only. But when I try to do both filter datas and print, it gives me the one I add in the original post.

In the input datatable you have passed already filtered datatable value “UsPlayers” there change it to ExtractDataTable and remove the double quotes for 2700

Hi @Kalle77 ,

Try this Linq USPlayerRank= ExtractDataTable.AsEnumerable().Where(Function(row) row.Field(Of String)("Column-3") = "USA" AndAlso row.Field(Of Integer)("Column-4") < 2700).CopyToDataTable()

1 Like

I dont understand. Do I put that to assign activity?

Hi @Kalle77,

To filter your data as needed, you’ll want to use two Assign activities:

  1. Assign 1: USPlayerRank = ExtractDataTable.Clone()
  2. Assign 2:
    USPlayerRank = ExtractDataTable.AsEnumerable().Where(Function(row) 
    row.Field(Of String)("Column-3") = "USA" AndAlso row.Field(Of 
    Integer)("Column-4") < 2700).CopyToDataTable()
    

Note : Provide the exact column names as your datatable

Could you try getting the type of column 4 ?

Thank you so much for your effort. Anyways, I got for using that a error: “Assign: Unable to cast object of type ‘System.String’ to type ‘System.Int32’.”

Try this where rank is a variable of data type datatable.

The issue was because the extracted table data type is string , and you were comparing a string with an integer

This is because the column 4 is of data type string.

Thank you, I tried this but its still the same error. I dont understand. I used “ready” named variable instead of rank for some reason. It’s variable datatype is Datatable.

Can you show the assign expression pls

You mean this?