Chris
Chris

Reputation: 515

Spotfire limit data by text

I have a string column [VEHICLE] that contains row variations of "car", "CAR", "car" and "car1". I'm trying to use a limit data by expression to exclude all of those variations. I've tried Lower([VEHICLE]) ~= "*car*" but it isn't working. Any ideas?

Upvotes: 2

Views: 5166

Answers (1)

S3S
S3S

Reputation: 25122

You were very close. In Limit Data Using Expression use this instead.

IF(Lower([Vehicle]) ~= "car*",true,false)

or even better... in case you have car$ or something that isn't a-z

IF(Lower([Vehicle]) ~= "car.*",true,false)

or if you expect something to become before car... like thisCar1 use this:

IF(Lower([Vehicle]) ~= ".*car.*",true,false)

In the second example, . is any character and * is stating match 0 or more of this instance. Without the *, which is what you had, it's stating match 0 or more of instances of... nothing. You just have to give it something to reference.

Remeber ~= uses Regular Expressions

Upvotes: 3

Related Questions