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

Force data type of input data

It would be a handy feature if it were possible to choose a data type for an input tool to read the data in as. For example, if a dataset has multiple fields with different data types, it would be handy to be able to make the Input Tool read and output them all as a string, if needed. This would also make a handy tool, a sort of blanket data conversion to convert all fields to the specified type.

14 Comments
cgoodman3
14 - Magnetar
14 - Magnetar

I've just come across this idea, after discovering the pain with a batch macro. In the batch macro I am updating company registration numbers to feed into an api. The placeholder company number starts with a zero so it treated as a string, and downstream when I want to create an output filename of [CompanyNumber]+"_output.yxdb", this is absolutely fine as it is a string.

 

But at some point my batch macro starts failing because the company number starts with a non-zero number and therefore it is passed into the macro and then the field type updates as a INT16. This is not desired behaviour, as external to the macro when you have a list of company numbers the field type being passed in is string

 

cgoodman3_0-1619602260329.png

 

It's only when you start getting these errors (potentially many hours after starting the workflow), that you realise what is happening and have to modify the macro with a select after the input tool (which I've spoken about here).

 

cgoodman3_1-1619602348591.png

 

I believe this could be considered to be a bug as everything the user sees in the set up shows the company number being treated as a string value, however the underlying behaviour is not this.

 

JayG
7 - Meteor

I have tried the "Option - 6 First Row Contains Data".

This did not resolve the issue of an input of a number from an Excel file.

For example, a cell content "3.7%" is saved as "0.0369999999999999".

 

An option to save Excel worksheet, to a CSV file worked (when a CSV file was manually saved from an Excel file) BUT not when tried using Alteryx to Input (Excel) and Output (CSV).

lliberm1
7 - Meteor

Ok so there are a few solutions I am aware of.

1) You can do a batch macro that dictates the field type by batching through a select tool but that is cumbersome.

 

2) If you want a quick fix, what I like to do is make a copy of the input file and call it "template" and then use one row of data where I'm filling out all the fields with dummy data.  I then union this to the actual data (make sure the template is #1 link to the union).  For example, when there are blank columns in the first row, the data may default to something you don't want it to, so using this template and union approach will fix that by having data in all columns.  I had an issue where I had a number with 5 decimals but it was reading the column as a string (since the first row had no data) so it truncated for some reason to 2 decimals after the initial input.  There was no way to get the 5 decimals back in the workflow as it was dropped in the input file.  By adding a template file and unioning it, I was able to fill that blank row in with dummy data (.00001) and it then read in as a double rather than string.  I am not sure if this will work for your specific scenario but I think this is a quick workaround that can be helpful in many scenarios.

 

I agree that the ability to set the data type within the input tool would make this a lot easier.

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