I'm not sure about the formula; but you can try renaming these column names in Tableau itself. Right CLick -> Rename!
Hope it helps!
The problem is that both names are in one field.
1 of 1 people found this helpful
Hi Amy I had created a packaged workbook to help you with this, but it doesn't appear that I can attach to this forums, so I will do my best to explain.
First you will want to find the position in the string of the comma/space in the name field so that you can tell the function where to start you're selection (See below):
Position of Comma
FIND([Name], "," )
Position of Space
FIND([Name], " " )
Next you need to create a calculation that selects the string values and then concatenates them in the correct order. I added them to an IF statement to say if there is a comma, then use the position of comma calc, otherwise use the position of space calc.
Proper Name Formatting
If CONTAINS([Name], "," )
then str(LTRIM(mid([Name], [Position of Comma] +1 ) ))+SPACE(1)+str(LTRIM(left([Name], [Position of Comma] -1 )))
else str(LTRIM(mid([Name], [Position of Space] +1 ) ))+SPACE(1)+str(LTRIM(left([Name], [Position of Space] -1 )))
All you should have to do is swap in your field name where I have [Name] in the above calculations and you should be good to go.
Hope this helps.
Thank you so much!!! That is easily the best explanation of those kooky string formulas that I've seen. Really appreciate it.