Alteryx Designer Desktop Discussions

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

Dynamically change field type

cjaneczko
13 - Pulsar

I have a cross tab where the headers are dynamic. They will change at each run of the workflow with the exception of the first two fields. Below is an example of the headers. Type and Year will always be the first two columns, but the numeric columns after it will change numbers, but they will always be numbers. I need to change the data type on all columns that have a number in the header from a V_String to Double. I have a feeling this will require the Dynamic Select tool, but I am not sure how to properly create the formula. 

 

I am thinking it needs to start as IF REGEXMATCH([NAME], '\d+') THEN ......... This is where I am lost. I need to change those field names that start with digits and have their field types changed to Double???

 

TypeYear100015002500030000
4 REPLIES 4
FinnCharlton
13 - Pulsar

Hi @cjaneczko , you'll have to use the dynamic select to select the fields you want, then a multi-field formula to change the data types:

FinnCharlton_0-1686057831090.png

 

FrederikE
13 - Pulsar

Hey @cjaneczko,

 

I would solve it using a multi-field tool: 

This will change everything unknown to doubles. 

 

FrederikE_0-1686057885164.png

FrederikE_0-1686057956776.png

 

 

binuacs
20 - Arcturus

@cjaneczko the dynamic select tool should work on your use case

 

binuacs_0-1686058129876.png

 

cjaneczko
13 - Pulsar

@FinnCharlton This worked perfectly. Thank you.

Labels