Alteryx Designer Desktop Discussions

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

TrimLeft Weirdness - removing more than text entered

phoebe_kelley
9 - Comet

Hello, I am trying to remove the leading string 'ZZZ DO NOT USE' from the longer string 'ZZZ DO NOT USE THE DOUGH'. When I use the TrimLeft function, it works as expected until I add the last 'E' in the remove string, and then it removes the 'E' from 'USE' but also the space and the 'T' after it!

 

phoebe_kelley_2-1632505379849.png

 

phoebe_kelley_3-1632505400650.png

 

Any help would be much appreciated!!

 

3 REPLIES 3
phoebe_kelley
9 - Comet

I would be ok with it removing the space, but not the 'T' from 'THE'

atcodedog05
22 - Nova
22 - Nova

Hi @phoebe_kelley 

 

Here is how Trim function works what Trim does is it doesnt remove the specific string instead it remove character in quote wherever they occur until a non-speicified character is encountered.

 

Case 1: TrimLeft([Field],"ZZZ DO NOT US")

Input: ZZZ DO NOT USE THE DOUGH.

 

Since E is not there in the specified text ZZZ DO NOT US it stops at E.

 

Case 2: TrimLeft([Field],"ZZZ DO NOT USE")

Input: ZZZ DO NOT USE THE DOUGH.

 

Since T is already there and H is not there in the specified text ZZZ DO NOT USE it stops at H.

 

Hope this helps : )

atcodedog05
22 - Nova
22 - Nova

Hi @phoebe_kelley 

 

You can use Regex like this instead which say if string is that the start remove.

 

atcodedog05_0-1632506079772.png

 

Hope this helps : )

Labels