In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Fractions to a Decimal

Tommy1
5 - Atom

Hello,

 

I have both decimal values and Fraction values within a "Nominal Size"  field.

 

How do I convert the all the fractions within the field to decimals  so I can set the field as a Double Variable? Simply 3/4 to 0.75

 

Thank you,

 

Tommy

5 REPLIES 5
ImadZidan
12 - Quasar

Hello @Tommy1 ,

 

Alteryx can do it for you. Is there a specific scenario you have .

 

Check attached.

PhilipMannering
16 - Nebula
16 - Nebula

You could split the number by forward slash using Text-to-Columns > then convert the numbers to integers > then calculate the quotient in a formula tool.

 

Example attached,

PhilipMannering_0-1598007930292.png

 

Tommy1
5 - Atom

Worked a treat! thank you for the quick response.

 

I also had some "#N/A" and "N/A" data within that column which I'll remove with a formula.

 

However, How do I now merge the newly created "decimal" field and the original "nominal size" field.

 

Basic question, I only started Alteryx yesterday  

 

Thank you

 

 

 

Tommy1
5 - Atom

I think I figured out my own question. To merge the data so the fractions are converted to decimals within the same field. I used the If statement:

 

IF Contains([1st End Nom. Thread Size], '/') THEN

tonumber([fraction1]) / tonumber([fraction2])

ELSE [1st End Nom. Thread Size]

ENDIF   

ImadZidan
12 - Quasar

Well done.

 

Its only the beginning. It get better 🙂 

Labels
Top Solution Authors