From the course: Tableau 10: Mastering Calculations

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Trim and pad strings

Trim and pad strings - Tableau Tutorial

From the course: Tableau 10: Mastering Calculations

Start my 1-month free trial

Trim and pad strings

- [Instructor] Text strings don't always arrive in exactly the format you need. Some will have extra spaces, at the left or right end, or both and others will be too short for a fixed link field in a database; in this movie, I'll show you how to trim unwanted spaces from your strings and add them if you need to. There are four functions that I'll cover and the first is LTRIM and LTRIM removes any extra blank spaces from the left of a string. RTRIM does the opposite; it removes the blank spaces if any from the right side of a string. TRIM removes both sides and in case you want to add spaces, perhaps, to make a value the right number spaces for a fixed link field, then you can use the SPACE function and specify the number of spaces you want to add, so, for example, if you have a string of an offer code and you want to add three spaces to it, then you can concatenate those values by taking the string of the offer code plus space three, so that would add three spaces to the end of the…

Contents