Video | Tableau | Data prep | Analytics

The Right () and Left () Functions in Tableau

RIGHT and LEFT are great for clean, consistent data - but pair them with a parameter and they suddenly become dynamic.

Part ofTableau Functions
Watch on YouTube
  • Right-click a field and choose Describe (then Load) to view its metadata and the first 20 or so values
  • RIGHT(string, number) returns characters from the end of a string and LEFT(string, number) from the start
  • Don't wrap an existing string field in quotation marks - Tableau adds quotes only to mark literal text, and adding them to a field name breaks the calculation
  • Hard-coded character counts only work on perfectly consistent data, so this technique has a limited use case on messy data
  • Swap the fixed number for a parameter to let users dynamically set how many characters are isolated

RIGHT and LEFT let you pull a fixed number of characters from either end of a text string, which is handy for splitting consistent, structured fields like IDs or codes into meaningful parts.

Tim works with an Order ID field made up of consistent, clean text codes. He uses it to isolate parts of the string and to flag a common mistake people make when following the documentation literally.

The Breakdown
  1. Check the field's values first 0:14

    Right-click any field and choose Describe (or Load if prompted) to see its metadata and roughly the first 20 values. Do this before writing a string calculation so you know the data is consistent enough for a fixed-character approach to work.

  2. Build the RIGHT function 1:26

    RIGHT(string, number) returns a set number of characters counting from the end of the string. You supply the field as the string and count how many characters from the right you actually need.

  3. Don't wrap a field name in quotation marks 2:40

    A common mistake is copying the syntax from documentation literally and putting quote marks around the field name. Quotes tell Tableau to treat the contents as literal text, not a field, so wrapping an existing string field in quotes breaks the calculation - only use them for actual typed-in text, and only if the field isn't already a string type.

  4. Duplicate to build LEFT the same way 5:30

    LEFT works identically to RIGHT but counts characters from the start of the string. Once you've built one, you can duplicate it, rename it, and swap the function name rather than writing it from scratch.

  5. Know the limits of a hard-coded count 6:22

    A fixed character count only works reliably when every value in the field follows exactly the same structure and length. As soon as data is inconsistent, this approach breaks, so it has a fairly narrow use case on real-world messy data.

  6. Swap the fixed number for a parameter 6:38

    Replace the hard-coded character count with a parameter so users can change how many characters are isolated on the fly. This turns a static calculation into a dynamic one, since parameters are user-editable variables stored in the workbook rather than the data source.

Worth Knowing
  • Quotation marks in Tableau calculations mark literal text, not fields - adding them around a field that's already a string will break the calculation
  • Describe (or Load) only shows roughly the first 20 rows, so it's a quick sanity check rather than a full data profile
  • Hard-coded RIGHT/LEFT counts assume every value has the same structure and length, so they're unreliable on inconsistent data
  • Parameters aren't stored with the data source - they live in a separate table inside the workbook and load dynamically when needed
Use It When

Reach for RIGHT and LEFT when you need to split out a consistent, structured text field, like a code or ID with a fixed format, and pair them with a parameter when you want users to control how much of the string gets extracted.

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.