Alteryx Designer Desktop Discussions

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

Add a delimiter twice

Farriyajawed
7 - Meteor

Hello, 

 

I have a number 127000000 and I need to change it to 1270-00-000. 

 

I am using this formula but it is not getting the complete statement: 

Left(ToString([Code]), 4)+"-"+Right(ToString([Code]), 2) 

 

2 REPLIES 2
apathetichell
19 - Altair
Left(ToString([Code]), 4)+"-"+Right(ToString([Code]), 2) 

 

you could do this via regex_replace with regex_replace([field1],"^(.{4})(.{2})(.{3})","$1-$2-$3") 

Prometheus
12 - Quasar

@Farriyajawed Try this: Left(ToString([Code]), 4)+"-"+Substring([Code],4,2)+'-'+Right(ToString([Code]), 3) 

Labels