Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

HOW TO CUT THE CHARACTERS SHORT

dunkindonut7777
8 - Asteroid

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.

 

FieldExpected Field
ApplesApple
SashimiSashi

 

Could you help me out with this one pls. Thanks

3 REPLIES 3
Qiu
20 - Arcturus
20 - Arcturus

@dunkindonut7777 
This should do it.

Capture6A1.PNG

DawnDuong
13 - Pulsar
13 - Pulsar

hi @dunkindonut7777 

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.

Example

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".

Christina_H
14 - Magnetar

A select tool to change the length of the field to 5 will also work

Labels