Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Formula In-DB dividing numerical fields results in 0 values

dsemitekol
7 - Meteor

Hello!

 

I am working with the In-Database tools, connecting to an SQL server.  I am trying to divide two numerical fields and create a new field.  The division should result in a decimal but the new field is showing only 0's.

 

Here is my SQL Expression that is created from the In-DB Formula tool:

"HD_Dist_Totals" / "Ind_Dist_Totals"

 

I have the Output Field creating new field as a Float Type.  The end goal is to divide the two fields to create a decimal and then convert them to a percentage.  My SQL knowledge is limited and I think that I am missing something in the statement, but my Googling has not helped.

 

Thanks for any help!

1 REPLY 1
dsemitekol
7 - Meteor

Okay, I think I figured it out.  I set my SQL Expression as the following:

 

SELECT CAST("HD_Dist_Totals" AS FLOAT) / CAST("Ind_Dist_Totals" AS FLOAT)

Labels
Top Solution Authors