Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

How can I take field types from another table?

marco_zara
8 - Asteroid

Hi,

 

I'm trying to automate the feature selection process in our machine learning process, dynamically filtering out all variables that have only 1 value and the string ones that have over 32.

I managed to do most of the job using a few basic data profile tools, followed by some filters to exclude unwanted columns and a cross-tab to get it back to columnar format.

 

My problem now is that this way I loose the original field type and I need to find a way to reassign it before I do an union to actually select the final columns. Is there any way to do it in Alteryx?

Workflow attached.

 

Thanks in advance!

3 REPLIES 3
JoeS
Alteryx Alumni (Retired)

Hi @marco_zara 

 

There is a macro within the CReW macros that does exactly what you are after.

 

They can be found here: http://www.chaosreignswithin.com/p/macros.html

 

However looking into CReW_DynamicMetadata I noticed there was a bug/

 

So please find attached one that should work. Along with it's sub-macro (CReW_DynamicMetadata.yxmcbatch) and your workflow (all be it I had to change your input data tool)

 

@MarqueeCrew  - The bug is with formula 17 in the macro. It was:

iif(isnull([Scale]), tostring([Scale]), tostring([Size]) + "." + tostring([Scale]))

but should be:

iif(isnull([Scale]), tostring([Size]), tostring([Size]) + "." + tostring([Scale]))

 

JoshuaGostick
11 - Bolide

Hi marco_zara,

 

One option is that you can save the field configuration of your input as a .yxft file and then load that in a Select tool to replace the new field types to the original field types.

 

Save the field configuration in the select tool like below.

 

Select Save Field Types.PNG

 

This will prompt you to save a .yxft file. Then, simply select Load Field Names & Types to update the Select tool.

 

The only problem with this is that it is not a dynamic process so let me know if you except the field names and types to change frequently.

 

Josh

marco_zara
8 - Asteroid

Thank you very much, this should solve the issue pretty effectively!

Labels