Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Alteryx is here to help you solve your biggest data challenges. Read about the new Virtual Solution Center here.
SOLVED

Dynamically Change A Field Type

11 - Bolide

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

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

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

 

 

 

 

 

 

Highlighted
11 - Bolide

Perfect! Thank you and have a nice weekend!

Highlighted
7 - Meteor

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?  

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

@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