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!
The Product Idea boards have gotten an update to better integrate them within our Product team's idea cycle! However this update does have a few unique behaviors, if you have any questions about them check out our FAQ.

Alteryx Designer Desktop Ideas

Share your Designer Desktop product ideas - we're listening!
Submitting an Idea?

Be sure to review our Idea Submission Guidelines for more information!

Submission Guidelines

Change the datatype of a column in the Formula component and rename

I often use the formula component to change the data type of a column, e.g. convert a string to a datetime.  What I normally have to do is create a new column and then use a select to drop the old column.  I would like to be able to do all of this in 1 operation, i.e. make the greyed out 'Data Type' active so I could choose to convert to data type datetime.  Would also be useful to rename the existing column in this operation too.

 

image.png

9 Comments
PopeAndrew
5 - Atom

Hi Spainn, 

 

The function you are speaking of is already built into the formula bar. In the output column select New Column and input your desired name. From there you can apply a formula to the newly created column in addition to changing the data type. Try it out and let me know if you have any questions!

T_Willins
14 - Magnetar
14 - Magnetar

I agree with spainn on needing this.  In response to PopeAndrew, there are times I need to keep the original field name (not allowed with selecting new column) for situations where I need to rejoin the field under the same name.  It is easy to rename in a Select tool, but being allowed to change the Data type in the Formula tool saves a step. 

esmosis
7 - Meteor

I found an easier method is to add a Select before the Formula, and then change the data types in there to your output data type.  It may cause more expressions in the Formula if you need to convert something from Number to String, include numbers in quotes, etc., but I find it easier most times than renaming all the columns.

 

However like you said, it'd be nice to have this in one step rather than 2.

MatthieuArzel
7 - Meteor

I agree with @T_Willins: Alteryx should allow the Formula action to transtype an existing column. It's so inneficient to create a new column to dump it the next select step. Please fix this 🙂

Joe_Lipski
13 - Pulsar
13 - Pulsar

I agree that it should be possible to change the field type of an existing field in the formula tool.

 

However, there is a neat trick that you can use a multi-field formula tool (instead of formula) to do this!

collin_pace
9 - Comet

I also agree changing the field type of an existing field should be added in the formula tool.  I'd rather not add a select tool beforehand or use the multi-field tool - both are great workarounds as is!  But as a quality of life improvement, adding that functionality to the formula tool would be great.  

 

 

patrick_digan
17 - Castor
17 - Castor

It would be nice to be able to change the datatype in a formula tool for an existing field.

ronhaworth
5 - Atom

I agree that allowing trans-typing an existing column in formula would be a very nice feature. It would-> prevent the needed for the Select->Formula->Select pattern for something as simple as rounding a string-based numeric.

AlteryxCommunityTeam
Alteryx Community Team
Alteryx Community Team
Status changed to: Accepting Votes