This is a Tableau Calculated Field? Or are you trying to write raw/passthrough SQL?
James this is a Tableau Calculated Field
Well, "like" and "find" are not part of the function library...
If you can provide some of the variations of the original text field, and what the result should be for each, I believe I can help you craft a calculated field that will give you the results you are looking for.
Sorry for the late reply.
I have a column companyid which will have values like x8AVG,X9HVG.
I know we can do this outside tableau but i just want to see how we can acheive in tableau if the third letter is like a then atlanta so on.
Any help highly appreciated.
Would something like this work:
CASE MID([companyid],3,1) WHEN "A" THEN "ATLANTA" WHEN "H" THEN "HOUSTON" WHEN "O" THEN "MOBILE" WHEN "N" THEN "NORTH" ELSE "RestOfAll" END
This takes the third character from the field "companyid", and if it is one of those four characters, it will give you a name, and otherwise "RestOfAll".
You could also create a calculated member where you can (and actually have to) use MDX