Video | Tableau | Data prep | Analytics

The MID Function in Tableau.

This one caught me out in a certification exam, so I made a video about MID before I could forget it again.

Part ofTableau Functions
Watch on YouTube
  • MID() returns characters from a string starting at a specified position, with an optional second argument controlling how many characters to return
  • Choosing position 2 effectively drops the first character; the start position is treated as character one for the length count
  • For neatly structured data, LEFT or RIGHT functions are usually simpler than MID
  • Wrapping FIND() inside MID() lets you dynamically locate a character, such as finding the position of an @ sign
  • Adding +1 to a FIND() result lets you start MID one character past the matched character, useful for extracting an email domain

MID() returns part of a string starting at a chosen position, with an optional length argument controlling how many characters come back. It's a fiddly, rarely-needed function on its own, but combined with FIND() it becomes a genuinely useful way to extract dynamic substrings like an email domain.

Demonstrated on Superstore subcategory names, then on a made-up email address field to build a more realistic example.

The Breakdown
  1. Basic MID syntax 0:54

    MID(string, position) returns everything in the string from that position onwards, counting the start position as character one. Choosing position 2, for example, effectively drops just the first character.

  2. See it in practice on real values 2:20

    Drop the calculated field next to the source field to watch how the start position lines up character-by-character across every row — a good way to sanity-check what MID is actually doing before relying on it.

  3. Add the optional length argument 3:14

    A second argument, MID(string, position, length), tells it how many characters to return after the start position, again counting that position as one. Without it, MID returns everything to the end of the string.

  4. When MID isn't the right tool 3:40

    For neatly structured, fixed-format data, LEFT or RIGHT are usually simpler and clearer than MID — reach for MID only when the position you need isn't fixed.

  5. Make the position dynamic with FIND 4:01

    Instead of hardcoding a start position, nest FIND() inside MID() to locate a specific character, such as an @ sign, so the extraction works even when its position varies row to row.

  6. Build the email-domain extraction 5:20

    Wrap FIND(field, "@") inside MID() as the position argument, then add +1 to that FIND result so extraction starts one character after the @ rather than on it. This must be done in this order — find the marker character first, offset it, then feed that into MID — and it leaves you with just the domain.

Worth Knowing
  • The start position argument is treated as character one for length-counting purposes, which can be confusing when combining it with FIND offsets.
  • Tableau's automatic field-splitting likely does something similar to this FIND+MID combination internally, so you don't need it for simple cases.
  • This is a brute-force approach — for genuinely messy or variable text, regex functions are usually a cleaner alternative.
Use It When

Reach for MID with FIND when you have semi-structured text data (like email addresses) and need to dynamically extract a substring whose position varies, but you'd rather avoid regex.

How this Rollup was made provenance & method

A Rollup is drafted by AI from the video's transcript, then reviewed and edited by Tim. Everything used to produce this one is listed below — the model, the exact prompt, and the source video — so the process is transparent and reproducible.

Transcription
On-device — NVIDIA Parakeet v3 for recent videos, OpenAI Whisper large-v3 for earlier ones. The transcript never leaves the machine or gets published.
Drafting
Claude Sonnet 5 in the cloud, from that transcript.
Prompt
The exact Rollup prompt (v2) — the full system prompt, unedited.
Source video
Watch on YouTube
Drafted
5 July 2026 at 09:38
Reviewed & edited
5 July 2026 at 09:41 · by Tim Ngwena

Model + prompt + video is everything you'd need to recreate a Rollup like this yourself. The one thing we don't share is the transcript.

Rights. The video and its transcript are the property of TN Media Ltd. Unauthorised use or download is prohibited. © TN Media Ltd.