Alteryx Designer Discussions

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

Keep leading spaces in the column names in excel output

joannasokolowska
8 - Asteroid

Hi all,

In the excel output I need to keep leading spaces in the column names (so I can use as template in other system which requires specific column names including all whitespaces).

 

Do you know how to keep all whitespaces in column names ? Renaming columns in the select tool didn't help. 

 

Thank you!

Asia

8 REPLIES 8
messi007
13 - Pulsar

@joannasokolowska,

 

Could you share a sample data, Alteryx will read the column as it come from Excel.

As you can see below I have 2 first column contains white spaces 🙂

messi007_0-1614692697848.png

 

Regards,

 

joannasokolowska
8 - Asteroid

Hey,

Thank you for a quick response. The thing is that that in input data it is without whitespaces but I want to add it into the output excel file. 

On your prtscreen I see that the outcome from select tool includes leading spaces (the same in my workflow)  but if you  save it as excel, and open in excel you will not see them there. 

 

Best,

Asia

echuong1
Alteryx Alumni (Retired)

If your output is going in a template, try using the preserve formatting option. You can have a template with just the headers, and append the data in.

 

echuong1_0-1614693545334.png

 

joannasokolowska
8 - Asteroid

hey,

Thank you for this suggestion but this will not work in this project ;/ The system requires file in specific format (including column names) . I do not want to add column names manually since there will be plenty of reports. 

 

I hope there is a still way for keeping leading spaces in the excel output..

 

Best,

Asia

patrick_digan
16 - Nebula
16 - Nebula

@joannasokolowska can you use ascii character 160? It looks the same to the eye, but I'm not sure if it will work for you.

 

patrick_digan_0-1614693811083.png

 

joannasokolowska
8 - Asteroid

Hey,

It solved the issue! thank you!

 

Asia

aesanchez
7 - Meteor

Great tip! I'm facing a similar application in which I need to retain leading spaces to comply with the target software's requirements. In this case, the requirement to maintain a fixed left with a variable number of leading spaces applies to the body of the table exported, not to the headers.

Thanks for the solution!

aesanchez
7 - Meteor

Ultimately, this solution worked with Excel but not with the target software. The alternative was to add and apostrophe to the text in order to retain the left padding required by the target software.

Labels