Replacing a portion of a string to a blank value and trimming it afterwards

This is similar to Find and Replace in Excel, what im trying to do is to remove the word “Prod:” and replace it with nothing and then trim the result afterwards, I also wanted to convert the final result to a short date format.

I keep getting this error, can anyone help me on this?
Thanks in advance!

Have you tried to swap string() and replace()?

Normally you apply the to string conversation only at the point where the non-string data is used. It looks like you’re now converting the entire replace function to string rather than the mentioned column specifically.

This is an example on how to convert an integer of value 1 to a string with value 0.

If this doesn’t work it would be helpful if you can share some examples of Header Notes Production Finish Date.

if I swap string() and replace()

then this is the error:
image

these are examples of the column Header Notes Production Finish Date .

Prod:9/30
Prod: 2/28

I see. Two issues are going on here: trim() is not a function available in String Manipulation, it’s has strip() instead. The function you’re using is not fully correct there. string() should only apply to $Header Notes Production Finish Date$. Since it is already of type string, the string() function is not required.

If you use strip(replace($Header Notes Production Finish Date$,"Prod:","")) it should give you the desired result:

4 Likes

great! this works now!

lastly, how about if I use String Manipulation (Multi column) since I have many columns to apply this with. I’m not really familiar with the right expression

lets say I have another column named: ‘ETA’ and i want to remove the word ‘ETA:’

should it be written like this?

image

cause im getting an error:

image

$$CURRENTCOLUMN$$ reflects everything that you added to the include section. As such, you should not use the column names themselves anymore like you have done but actually replace them by $$CURRENTCOLUMN$$

Next, you cannot use sequential functions like this in a String Manipulation node, you have to nest them: strip(replace(replace($$CURRENTCOLUMN$$,"ETA:",""),"Prod:",""))

Input:
image

Output:

4 Likes

Thanks ArjenEX for helping me!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.