Alteryx Designer Desktop Discussions

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

Reformat based on data types

UnknownUser
7 - Meteor

Hi, 

 

I'd like to reformat each column based on it's data type to create a fixed width file. So e.g. if it's V_String I'd like to pad spaces to a fixed width of 40. If it's an Int I'd like to transform a "123" into a "0000123" and so on. The output data type of all columns would then be a string.

Any ideas? 

 

Thanks! Felix 

4 REPLIES 4
NickC
Alteryx Alumni (Retired)

Hello,

 

You will want to use the formula tool or the multi formula tool to achieve this.  I have used 2, 1 for the numeric fields and 1 for the string fields.  

padding.png

 

 

 

Workflow attached.

 

Nick

UnknownUser
7 - Meteor

Thanks!

 

Another question: do you know how to specify the goal format in Alteryx?

 

E.g. I'd like to specify that -0.1 is written as "-0000000.10" string.

UnknownUser
7 - Meteor

Follow up question: is it possible to define the format on a more granular level? E.g. for int16 instead of numeric?

ZacharyM
Alteryx Alumni (Retired)

You can throw a Dynamic Select in front of the setup that was outlined above - this tool will let you select at a more granular level than the Multi-Field Tool.

 

https://help.alteryx.com/2018.2/DynamicSelect.htm

Labels