Hi I have a data that I want to trim the characters in its expected count. I want to cut if it exceeds five characters.
Field | Expected Field |
Apples | Apple |
Sashimi | Sashi |
Could you help me out with this one pls. Thanks
@dunkindonut7777
This should do it.
Someone else asked almost the same question a few post earlier.
If you are new to Alteryx and are learning how to handle String data types, a good place to start is to look at the Help document. For String function, the link is https://help.alteryx.com/20213/designer/string-functions
In this specific case, if you are looking at simple character count, substring is likely the most efficient.
Substring
Substring(String, start, length): Returns the substring of (String) starting at (start), stopping after (length), if provided.
Substring("949-222-4356", 4, 😎 returns "222-4356".
Substring("949-222-4356", 4, 6) returns "222-43".
Substring("949-222-4356", 4) returns "222-4356".
A select tool to change the length of the field to 5 will also work