Learn more about the Alteryx Maveryx Universe recently announced at Inspire 2023!

Alteryx Designer Desktop Discussions

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

Question on data import from Excel

8 - Asteroid



Just wondering if someone might give me some ideas...  I am importing from excel some data.  One field did not have format set correctly in excel file.  It's a version field.  While Alteryx imports it into a text field  sometimes it has numbers such as "4.1" and some times "vx8.3" along with other data.  If the field truly has alpha numeric data then it needs to stay as text... however something like 4.1 due to translation from excel changes to 4.099999 or some lengthy floating point.


So I need to import the data in and if it is a floating point use the function ToNumber(ToString([Version],1)) to convert it to a text string of "4.1"  (or something similar).


I've looked through the forum (I'm on 10.5) and am trying to do something like...


if IsInteger([Version]) then ToString(ToNumber([Version]),1)
else [Version]


This does not change the value... it keeps is at 4.09999


It appears that any data that has 4.09999 or 1.10001 is treated as a string.  I tried using IsNumeric and it came back false.  Just wondering if there is an easy way to check if a text field can be checked for a floating point number?  Then if it is a float then convert to a number with 1 decimal place else just use the original text value.


What was originally simple has turned out to be a bit complicated.


Thanks for any insight.  I searched but didn't find any direct solutions in the forums.





8 - Asteroid

Ended up using following if statement:


if ToNumber(Trim([Version]))!=0 then ToNumber([Version])
else [Version]