How can I analyse a text string in Tableau?

It’s not much different than analysing a text string in SQL 😉

Tableau uses more or less the same standard text functions that you will find in SQL.

Let’s use a sample dataset of TEDx videos – ted_main

Assuming I want to check if there is any correlation between the number of views a video gets and the number of words in its title

The first thing I would want to do is create the following calculated field in Tableau


Remember the technique?

  1. It counts the total length of your string
  2. It subtracts the number of characters once spaces have been removed (this gives you the number of spaces in a string)
  3. Adds 1 (as you always have 1 word more than you have spaces)

Voila – you’ve got the number of words making up your string!

How do I check if my text strings has any punctuation peculiarities?

This is a bit more annoying as unlike SQL, Tableau calculated fields do not support the “in” operator, ultimately setting you up for a bit more typing.

Nevertheless, you can still get an adequate feeling for the type of punctuation that dominates your strings

Want to check out the actual workbook? – You can find it here

Happy vizzing!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.