
1. Re: CONTAINS formula: correctly using
Shinichiro Murakami Mar 15, 2017 7:12 AM (in response to Dilyana Suleymanova)Hi Dilyana
In this case Tableau is confused with "201" with "2017"
With assuming your data always has space before anda after "201" or "401", the formula should be like this.
[Calculation1]
if CONTAINS([Field Name]," 201 ") then "Fax"
ELSEIF
CONTAINS([Field Name], " 401 ") then "Email"
END
Thanks,
Shin

Contains_SM_9.3.twbx 5.7 KB


2. Re: CONTAINS formula: correctly using
Irfan Ahamad Mar 15, 2017 7:12 AM (in response to Dilyana Suleymanova)1 of 1 people found this helpfulHi,
You can use the below formula
if CONTAINS("LPST 2017 201 01","201 ") then "Fax"
ELSEIF
CONTAINS("LPST 2017 401 01", "401 ") then "Email"
END
Just added one extra space.
Regards,
Irfan

3. Re: CONTAINS formula: correctly using
Gerardo Varela Mar 15, 2017 7:16 AM (in response to Shinichiro Murakami)1 of 1 people found this helpfulWow Shinichiro you're super quick! I was working on a response and by the time I worked it up you had already answered. I hope you don't mind me posting my solution. Here's mine:
It essentially does the same thing.
Regards,
Gerardo

4. Re: CONTAINS formula: correctly using
Shinichiro Murakami Mar 15, 2017 7:44 AM (in response to Gerardo Varela)1 of 1 people found this helpfulGerardo,
I don't mind at all and that always happens, sometimes I win, sometimes you win.
Yours are also good AS LONG AS the description of "LSPT" part is always "4" digit.
Thanks,.
Shin

5. Re: CONTAINS formula: correctly using
Gerardo Varela Mar 15, 2017 11:44 AM (in response to Shinichiro Murakami)I didn't even think about the description changing. Thanks Shinichiro!
Regards,
Gerardo