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

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