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

Dynamically Change A Field Type

smoskowitz
12 - Quasar

Hello --

 

Is there a way to Dynamically change the field type based on the Field header names? For instance:

 

txt_One      txt_two   num_one   bool_two  txt_three

 

If I wanted to change all fields that started with txt from String to vString how can I do that? I feel that Dynamic Replace might be the ticket, but I have not yet had success in making this happen.

 

Thanks,

Seth

4 REPLIES 4
CharlieS
17 - Castor
17 - Castor

I've attached an example that uses the Dynamic Select tool and the Multi-Field Formula tool.

 

- The Dynamic Select only selects the fields based on the name of those fields.

- Multi-Field Formula has an option to "Change Output Type to" to set the new field type of the dynamically selected fields.

- (Messy) I rejoined by position, with the original on the Right input so that I can use another Dynamic Select to deselect any fields with a "Right_" prefix (the original fields with original field types).

 

20181207-DynamicFieldType.png

 

 

 

 

 

 

smoskowitz
12 - Quasar

Perfect! Thank you and have a nice weekend!

ssjl
8 - Asteroid

Thank you!  I've implemented this internally with the URL to this post in the comments.  Is there a better way to give you citation credit?  

CharlieS
17 - Castor
17 - Castor

@ssjl 

 

I'm glad this information was helpful. Citation is not necessary, but I hope the usefulness of this information inspires other to participate in the Community. 

Labels