Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Dynamically update Datatypes

kamels
5 - Atom

Hi, 

 

Is there a way when new columns come into my workflow, they can automatically update to be a fixed decimal or any type of number field? They are currently coming in as V_String and I was hoping that this would be something I wouldn't have to do manually. 

 

10 REPLIES 10
CoG
14 - Magnetar

The Auto Field Tool may be useful for you.

kamels
5 - Atom

Do you have any advice on how to use that? I could not figure out how to use that tool to create a Fixed Decimal, when I ran the workflow nothing changed. 

jrlindem
11 - Bolide

Like @CoG recommended, the Auto Field Tool is a good way to accomplish this.  That said, if there are characters in your field that don't cause Alteryx to automatically detect it as a number field, it's not going to assign Fixed Decimal or Double or Int types....

Another alternative is to use the Field Info tool to help identify the fields that are coming into your workflow, then you can flag them using a formula tool and convert them using the Multi-Field Formula Tool, using a formula like ToNumber([field]) to get the data to act as numbers.  This is a lot more complex, though and harder to illustrate.  Recommend doing some searching on this combo of tools to get what you want.

Hope that points you in the right direction.  -Jay

flying008
15 - Aurora

Hi, @kamels 

 

Could you please tell me, Was the name of new field is fix or dynamic ?

kamels
5 - Atom

The field is dynamic. It is the month number and year combined. (For example, March 2025- "0325") It has all 12 months in it at the same time, but it is dynamic because the following year, all the dates will update to "0326" ect.

Diederik_vanderharst
8 - Asteroid

@kamels 
Put a text tool with dummy values for the known fields on your canvas and set the required data types via select tool. Then put a select records on it, and let no records pass on. After the select records place a union and union it with your regular input. If the stream from your "template" is first to connect to the union unioned streams will inherit that schema.
About the dummy values. If you know that they are months of the year, then you can prep 60 fields for the next 5 years, plus the standard fields, and have it union on common subset.

Good luck! Let me know how you did. See pics below. And don't forget, connect the template to the union first. Otherwise delete the union and try again.

Scherm­afbeelding 2025-10-09 om 14.00.19.png

Scherm­afbeelding 2025-10-09 om 13.56.39.png

Scherm­afbeelding 2025-10-09 om 14.02.47.png

Here's a quick example how to create that template. You can also make that more dynamic using a generate rows tool in stead of text input.

Scherm­afbeelding 2025-10-09 om 14.08.25.png
Last edit: I transform everything to V_string here, not noticing that you needed a number type. Should not matter obviously.

Not a fan of autofield. If data typing is important, do it yourself.

flying008
15 - Aurora

Hi, @kamels 

 

FYI.

 

REGEX_Match([Name], '[01]\d2\d')

录制_2025_10_10_11_44_45_889.gif

apathetichell
20 - Arcturus

Auto-field will not swap vstring to fixed_decimal ---> it will swap v_string to string with a size of the max_entries in the field. 

CoG
14 - Magnetar

@apathetichell 

That is incorrect. If a string field has only numeric values, the Auto-field will convert it to a numerical type. If whole numbers, then one of the int types, otherwise a double. The OP mentioned Fixed Decimal or "any numerical type". This is precisely what the Auto-field tool was built to do. That being said, you are certainly correct that Fixed Decimal would require a more complex solution as others have already suggested.

Labels
Top Solution Authors