Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Set Field Lengths in Select Tool Without Manual Entry

mobermeier
6 - Meteoroid

Hello, I was wondering if there was a way to set the fields in my output as Strings of varying max field lengths without having to go into the Select Tool and set each field length manually.  Sometimes I have 250+ fields and it can be time consuming and error prone!  I'd rather have these values in an Excel file or some other table where I can cut and paste from the file format document and then verify that they are correct before uploading. I set these field lengths before outputting the data in FLAT fixed width file format.  I'm attaching an image of my select tool.

 

Thank you for the help.

Mary

4 REPLIES 4
PaulN
Alteryx Alumni (Retired)

Hi @mobermeier,

 

Select tool (https://help.alteryx.com/current/AlteryxSelect.htm) could use format described in YXFT files, would it help?

 

 

AlteryxGui_2019-06-16_14-36-17.png

 

Although these files are created via "Save Field Configuration" in Select tool, menu Save/Load, they could be modified via a simple editor as they are just XML files.

 

Example:

 

Code_2019-06-16_14-37-46.png

 


Best,

 

Paul Noirel

Sr Customer Support Engineer, Alteryx

danilang
19 - Altair
19 - Altair

Hi @mobermeier 

 

Here's a completely dynamic solution that uses the Dynamic Metadata macro available in the excellent Crew Macro Pack.

 

WF.png

 

The example I provided reads the metadata from the Name, Type and Length columns in the excel file and uses these to change the size of the input data

 

In order to use this, you'll have to download and install the entire Pack from the link, since the Dynamic Metadata macro uses some of the other macros included in the pack.

 

You may have reservations about using a set of 3rd party tools, but the pack contains a bunch of useful additions to the built-in tools and is highly regarded by the community.  Of course, if IT has restrictions about using something like then all bets are off.

 

If you don't want to or can't use this macro, let me know and I'll see if I can't come up with something that provides similar, though probably less refined,  functionality

 

Dan

 

mobermeier
6 - Meteoroid

Thank you!  This does work and is definitely a possibility for file formats that don't change much from file to file- the only  part that I can't still do easily is analyze the format data prior to uploading (meaning I want to make sure a certain field is starting in a certain position, etc).  But definitely worth keeping as an option for some situations.  I hadn't noticed the "Save Field Configuration" feature before in the Select Tool and didn't know how to modify those YXFT file types- so that was very helpful.  Thanks for taking the time to help!

 

Best,

Mary

mobermeier
6 - Meteoroid

Hi Dan,

 

Thank you!  This did the trick and wow- after having set all those field lengths manually, this did it in a snap.  I'm looking forward to checking out the other capabilities with this macro as well.  It was nice meeting you at Inspire 2019!  Thanks again!

 

Best,

Mary

Labels