community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Announcement | We'll be doing maintenance between 9am-11am MT on Saturday, January 25th, which may impact your experience. Thanks for your patience as we work on improving the community!
SOLVED

Formula In-DB dividing numerical fields results in 0 values

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!

Highlighted
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