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
Solved! Go to Solution.
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:
=============================
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
Chris
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
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.
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
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. 🙂
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
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.