3 Replies Latest reply on Jul 19, 2016 7:04 AM by Peter Seok

# If Statements with Wildcards

Hi Everyone,

I have a question on using if statements with wildcards.  I have a code that's alpha numeric, and the last 3 digits are always a specific 3 digit number.  I'd like to exclude anything that's in the 800 - 899, and 700 - 799 range, and I figure it should look something like this:

IF RIGHT([Code],3)=8** THEN "Exclude" ELSEIF RIGHT([Code],3)=7** THEN "Exclude" ELSE "Include" END

Doesn't seem to be working, any help would be greatly appreciated, thanks in advance!

• ###### 1. Re: If Statements with Wildcards

RIGHT(string, number) will return a string. If you convert this to an Integer then you could setup an IF statement that compares the output to the range you want to exclude.

I am not aware of how to use a wildcard in Tableau.

• ###### 2. Re: If Statements with Wildcards

Why not just use a simple Boolean:    Int(right([code],3)) > 699   AND   Int(right([code],3)) < 900

• ###### 3. Re: If Statements with Wildcards

Thanks John and Naveen.  I'm going to go with the Boolean, that works perfectly well.  Just for my future reference, I'm assuming tableau formulas do support wildcards?