Contains (Like) operator in Tableau
SInce there is no like operator in Tableau it provides CONTAINS operator.
Little different syntax is there but not too complex.
Syntax for contains is:
Below is the example for using CONTAINS operator in a calculated field in Tableau.
Ex:IF (CONTAINS([campaign_name],"Intent")) OR (CONTAINS([campaign_name_derived],"Intent")) THEN "Yes"
ELSE "No" END
Another Ex:
IF (CONTAINS([Runresults],"Failed")) OR (CONTAINS([Runresults],"Missed")) THEN [Total Runs]
ELSE 0 END
ex2: IF (CONTAINS([Lead Unit],"ARV")) OR (CONTAINS([Lead Unit],"SARM")) OR (CONTAINS([Lead Unit],"LEX") OR (CONTAINS([Lead Unit],"TEX"))) THEN "SAX"
ELSEIF (CONTAINS([Lead Unit],"AMTK")) OR (CONTAINS([Lead Unit],"AMK")) OR (CONTAINS([Lead Unit],"AMTK.L.CDTX") OR (CONTAINS([Lead Unit],"CDTX"))) THEN "AMK"
ELSEIF (CONTAINS([Lead Unit],"BNF")) OR (CONTAINS([Lead Unit],"BIF")) THEN "BIF"
ELSEIF (CONTAINS([Lead Unit],"UIP")) OR (CONTAINS([Lead Unit],"ULP") OR (CONTAINS([Lead Unit],"NSS") OR (CONTAINS([Lead Unit],"NKS")))) THEN "UTR"
ELSE 'Other' END
Comments
Post a Comment