Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Pad middle with fixed character length

mzlee
7 - Meteor

Hi,

 

Let me know if there is a tool that can do this! thanks!!

 

Invoice #:  GHMCC5300 

Amount: -55611175

 

What I need to accomplish is a total string of 24 characters adding zeros before the amount but after the negative sign. The 8 is a fixed digit. 

 

8 GHMCC5300-000055611175

4 REPLIES 4
cjaneczko
13 - Pulsar

Is the Invoice and Amount on two different rows or are they in two different columns?

mzlee
7 - Meteor

They are in two different columns - thx!

cjaneczko
13 - Pulsar

Try this. 

 

'8 ' + [Invoice]+ '-' +padleft(REGEX_Replace(tostring([Amount]), '-', ''),12,'0')

 

image.pngimage.png

mzlee
7 - Meteor

This worked perfectly! thank you 

Labels
Top Solution Authors