In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Add multiple blank spaces between a string

mzlee
7 - Meteor

Hello, I am looking to concatenate columns into one string but I also need to format it with multiple spaces in between 

 

Example:

 

Column 1         Column 2            Column 3

2835                    2900                  0000A2

 

I need the string to look like below, having a fix amount of blank spaces in between:

 

2835         2900                 0000A2  

 

thx!

6 REPLIES 6
Deano478
12 - Quasar

@mzlee How many fixed spaces do you need?

 

Luke_C
17 - Castor
17 - Castor

Hi @mzlee 

 

Assuming you're outputting to a fixed width file you could try something like this with the padright function:

 

padright(tostring([Column 1]),14,' ') + padright(tostring([Column 2]),21,' ') + [Column 3]

 

This thread may also help you: https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Create-a-fixed-width-output-us...6

 

image.png

mzlee
7 - Meteor

I need 6 fixed spaces between Column 1 and Column 2, and 10 fixed spaces between column 2 and Column 3

Luke_C
17 - Castor
17 - Castor

Hi @mzlee 

 

Is that 6 and 10 no matter the length of the data in the column originally?

mzlee
7 - Meteor

Hi Luke,

 

Yes, should be a fixed length as well of 30 characters. Sorry for not adding that information on my initial question!

Luke_C
17 - Castor
17 - Castor

@mzlee 

 

This should work assuming columns 1 and 2 are always 4 characters. padright(tostring([Column 1]),10,' ') + padright(tostring([Column 2]),14,' ') + [Column 3]

Labels
Top Solution Authors