Alteryx Designer Desktop Discussions

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

setting excel input data types

mstoler
8 - Asteroid

Hello,

 

I am reading in an excel file with a percent number.   Alteryx is storing this as a double which I later convert using the select tool to a decimal.

 

The problem is when I convert to a decimal I am losing a very small amount of precision.  Is there a way to set the data type on the input tool so that I can store it as a decimal value during the input?

 

Thank You,

 

Michael

 

7 REPLIES 7
ChrisTX
15 - Aurora

Double includes decimal places.  When you say you're converting it to a decimal, are you wanting a fixed number of decimal places?

 

Here is some information on using the Round function:

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Formula-Round-4-975-0-01-getting-4-97-...

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Rounding-Down-to-first-Decimal/td-p/24...

 

https://community.alteryx.com/t5/Alteryx-Designer-Discussions/another-rounding-question/m-p/423279#M...

=============================

round([163.575, 0.01) = 163.57
round([163.575, 0.02) = 163.58

 

And here's some information to view the data as-stored in Excel:

 

How to check for encoding or formatting issues with Excel worksheets

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/How-to-check-for-encoding-or-format...

 

Chris

mstoler
8 - Asteroid

Hello,

 

Yes I understand Rounding but what I would like to do is set type to decimal on the input tool.

 

As an example when I have .2121 in Excel this comes into Alteryx as a double with the value .21210000000000001.

 

The 000000001 is not in the Excel file.

 

Thanks,

 

Michael

CharuGupta
7 - Meteor

Hi,

If your excel has fixed number of decimals for a field then you can use Fixed Decimal data type for that field in Select tool and define number of decimal places rather that using double data type.

mstoler
8 - Asteroid

Hello,

 

Yes I am doing that but before it gets to the Select tool it is already a Double.

 

I would like it to be always stored as a Decimal.

 

Michael

 

CharuGupta
7 - Meteor

Hi Michael,

As far as I know, alteryx determines the data type based on the input and we can change the data type using Auto field or Select tool.

I would also like to know if there is an option to change the data type while inputting the data. 🙂

 

mstoler
8 - Asteroid

Hello Charu,

 

Yes it would be a good idea if the input tool could also set the data type.  

 

This is probably not a big deal for most applications but sometimes when exact precision is required it would be useful.

 

Thanks again for your feedback.

 

Michael

 

ChrisTX
15 - Aurora

In the input data tool, you can select the box for First Row Contains Data.  This will cause all values to come in as V_String.  Use Dynamic re-name to re-name the fields using the first row of data.  Then manually set each field's data type to what you need.

Labels