top of page
  • Bernard K

The MID Function in Tableau


The Syntax

MID (String, Start, Length)

This function returns the characters in a string starting at index position ‘start’. Note, the first character in a string is position 1. If the optional argument ‘length’ is added, the returned string includes only the number of characters specified.

For example.

MID (“Dashboards”,5) = “boards” (returns all characters starting at position 5)

MID (“Dashboards”,2 ,3) = “ash” (returns 3 characters starting at position 2)

Use case of MID function in Tableau

There are several ways you can use the MID function in Tableau.

One way is when converting a string into title case.

E.g. Converting the string ‘dashboards’ into ‘Dashboards’ using the following calculation.

UPPER(LEFT(“dashboards”,1)) + MID(“dashboards”,2)

Another way you can use the MID function is when extracting the username from a twitter handle.

E.g. extracting the username “rigordatasolns” from the twitter handle “@rigordatasolns” using the following calculation.

MID (“@rigordatasolns”,2) = “rigordatasolns”

I hope this short article was helpful to you. To receive more of the Tableau tips, kindly join our mailing list by subscribing below.

Thank you for reading.


Black & white.jpg

About Me

More About the Author

Bernard K

Analytics Consultant | 3X Tableau Certified

Bernard is a data analytics consultant helping businesses reveal the true power of their data and bring clarity to their reporting dashboards. He loves building things and sharing knowledge on how to build dashboards that drive better outcomes.

Let’s discuss your data challenges! Let’s work together!

bottom of page