10 Tableau String (Text) Functions in 10-ish Minutes

By: Eric Parker

Eric Parker lives in Seattle and has been teaching Tableau and Alteryx since 2014. He's helped thousands of students solve their most pressing problems. If you have a question, feel free to reach out to him directly via email. You can also sign up for a Tableau Office Hour to work with him directly!

Need help with your Tableau calculations? Sign up for an office hour to work with Eric! Want to dive deep into Tableau? Check out our upcoming Tableau classes!

Manipulating text is one of the primary use cases for Tableau calculations. There are all sorts of things you may want to accomplish with string functions.

·       Concatenate multiple text values into a single value.

·       Grab characters from the beginning, middle or end of a text string.

·       Filter on whether certain text criteria are met.

And that’s just the tip of the iceberg! If you want to learn all about Tableau string functions, check out the video below. We cover 10 key functions (LEFT, MID, SPLIT, TRIM, FIND, STARTSWITH, CONTAINS, LEN, REPLACE, STR) and finish with a bonus round and brief discussion surrounding seven extra functions (FINDNTH, ENDSWITH, CHAR, LOWER, UPPER, MIN, MAX, RIGHT).

Want hone your all-around Tableau String/Text functions game? This week’s video is for you!

Want to download the workbook to scope out the calculations? You can access it on Tableau Public here!

More on Wildcard (text match) filters here.

Here are the calculations from the video for each of the 10 functions.

LEFT

[Country Code] | LEFT([Country Code & Name],3)

MID

[Area Code] | MID([Phone Number],2,3)

SPLIT & TRIM

[Military Enlist Category] | TRIM(SPLIT([Military Headcount Status (Military Headcount Status)]," ",1))

FIND

[First Name Length] | FIND([Customer Name]," ")-1

STARTSWITH

[3M Products] | STARTSWITH([Product Name],"3M")

CONTAINS

[Printer / Copier] | CONTAINS([Product Name],"printer") OR CONTAINS([Product Name],"copier")

LEN

[Marriage/Child Status] | TRIM( MID([Military Headcount Status (Military Headcount Status)], LEN([Military Enlist Category]) +1, LEN([Military Headcount Status (Military Headcount Status)])-LEN([Military Enlist Category])-LEN([Gender]) ) )

REPLACE

[Product Name Update] | REPLACE([Product Name],"Eldon","NVent")

STR

[Country Code, Name & Number] | [Country Code & Name] + " (" + STR([Country ID]) + ")"

How to Create Dynamic Labels for Tableau Highlight Tables

How to Highlight a Single Column in Tableau

0