Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Knowledge Base

Definitive answers from Designer Desktop experts.

Error: The formula "[formula_name]" resulted in a string but the field is numeric. Use ToNumber(...) if this is correct.

Alteryx_KB
Alteryx
Alteryx
Created

Environment Details


  • Alteryx Designer
    • All versions
  • Formula
  • Generate Rows
  • Multi-Field Formula
  • Multi-Row Formula


Cause


The formula “X1” specified in the error message - Expression #1 in the below example – is operating on an existing numeric field, whereas the components of the expression ([Y1] and [Y2]) are string fields. This error also applies to newly created numeric output columns.

Resolution


String fields often contain numbers that are stored as strings, such as revenue in a .csv file. If the expression was intentional, the function ToNumber() will convert the string to a numeric type for use in the formula. This will not change any of the data types downstream of the Formula tool. 
 

Additional resources:
Alteryx Help - String Functions