Trim
Last updated
Was this helpful?
Last updated
Was this helpful?
Values sometimes have spaces at the start or end because of mistakes in data entry or the use of a split operation to break apart a CSV (comma separated list). These aren't always easily visible but can cause problems if you're trying to do exact matches for a . Trim allows you to strip out trailing or leading characters (usually white space by default) to clean up your text field.
=~TRIM!~(‹string›)
Tableau supports three TRIM()
operations:
~TRIM!~(‹string›) removes leading and trailing spaces
~LTRIM!~(‹string›) removes leading spaces only
~RTRIM!~(‹string›) removes trailing spaces only
Alteryx supports three TRIM()
operations:
~TRIM!~(‹within_string›«, target_string») removes leading and trailing characters
~TRIMLEFT!~(‹within_string›«, target_string») removes leading characters only
~TRIMRIGHT!~(‹within_string›«, target_string») removes trailing characters only
NB. If «target_string» is excluded, the default behaviour is to trim whitespace. If it is included, you can specify what character to trim:
Gizmo does not support Trim
operations, although OrgVue workspace will usually trim strings by default.
~LTRIM!~(‹string›) removes leading spaces only
~RTRIM!~(‹string›) removes trailing spaces only
To remove leading and trailing spaces, use ~RTRIM!~(~LTRIM!~(‹string›))
‹string›.~strip(«target_string»)!~
NB.
If «target_string» is excluded, the default behaviour is to trim whitespace.
If «target_string» is included, you can specify what character to trim.
The above examples assume variables have been declared for jobRole
and jobCode
. For more information, go to .