Exclude several values from filter table activity - Option strict on disallows implicit conversions from string to long

Hello everybody,

I have delete rows of my excel sheet, which have certain values. Furthermore, my process requires to work with the data in this specific excel sheet, since they are connected to other files.

I have to delete all rows with the Name “PP”, “PK” or “PM”. In the community forum I found the solution to first use read range in order to get all names in a data table and then assign all names except those three to an string array. This array is then used in the filter table activity.

For the assignment I used:
dtValues.AsEnumerable.Where(Function(x)Not(x(“Name”).ToString.ToLower.Equals(“pp” OR “pm” OR “pk”))).Select(Function(y)y(“Name”).ToString).ToArray

Unfortunately it cannot be validated: Option strict on disallows implicit conversions from string to long. Does anybody know what to do?
Thanks! :slight_smile:

@silvia93 I think the the way you have used the OR operation is the problem, Try this :

dtValues.AsEnumerable.Where(Function(x)Not(x(“Name”).ToString.ToLower.Equals(“pp”) or x(“Name”).ToString.ToLower.Equals(“pk”) or x(“Name”).ToString.ToLower.Equals(“pm”) )).Select(Function(y)y(“Name”).ToString).ToArray

1 Like

It works, thanks!

1 Like

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