The MID Function in Tableau
top of page

The MID Function in Tableau

Writer's picture: Bernard KilonzoBernard Kilonzo
persons reading in a laptop

Introduction

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.

Original.png

We Support You Deliver Business-Focused Solutions That Enable Data-Driven Decision Making.

  • Tableau profile
  • YouTube
  • White LinkedIn Icon
  • Facebook
  • X

QUICK LINKS

CONTACT US

+254 738 307 495

East Gate Mall, Donholm

3rd Floor Suite No. 3i

Nairobi, Kenya

Join our mailing list

bottom of page