ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
GELÖST

Numeric Operator to String - help, please

KWARD
Atom

Hello, 

 

I'm completely baffled with this, Googled and searched on here, trying to use suggestions of the tonumber. 

 

The error is happening at characters 163 & 28 but not on the previous lines that are similar. 

 

Can someone assist me before my head explodes please? 

 

Thank you so much.

 

KWARD_1-1768228396107.png

 

9 ANTWORTEN 9
binu_acs
Polaris

@KWARD Your PAY Tax variable is string type, change to double , apply the same for all the other numerical fields

KWARD
Atom

Thank you, I've tried to amend all three to double but still have this error - 

binu_acs
Polaris

Can you check the [Tax Band] and [Home to work] fields are  double data type ?

OllieClarke
16 - Nebula
16 - Nebula

FYI @KWARD The "Expression #1/#2" in the error message tells you in which window in the formula tool the error is occurring.

As it is occurring in the first window, either [Tax Band] or [Home to Work] is likely to be a string rather than a numeric data type

KWARD
Atom

Hello, sorry for the delay replying. 

I've amended the 'Home to Work' and 'Work to Home', also amended PSA Calcs, these are all working fine (strange they're in a different format and I don't understand how it works to be honest). 

 

I'm now up to the PAYE Tax formula, where the error now sits. I've attached snippets.. Apologies, since upgrading SAP the format of reports are now different therefore trying to update the workflow.

 

I have tried to look at guidance on here and Alteryx training, clearly I need much more help 😆.

 

Thanks, Kirsty 

SPetrie
Pulsar

Just to clarify, when you are setting the fields to be double as shown in your screenshots, you are telling it that the output will be a double. The errors are occurring because your inputs are not numbers and that is where the fix needs to be applied. Try updating your formula to be ToNumber([Expense Claimed Ammount]) and see if that helps resolve it.

Another option would be to use a multi-field formula and select any text field that should be holding only numbers and use a formula to convert them to numbers.

KWARD
Atom

Thank you for explaining. I have since updated the data types in the formulas but the error has moved along. 

 

If I add formula to be ToNumber([Expense Claimed Amount]) at the first formula Home to Work, will I have to add it to the remaining formulas i.e. PSA Calc and PAYE Tax too please?

 

Thank you, Kirsty

SPetrie
Pulsar

As long as all your fields you are trying to do math on are numbers, and you keep your output data types as numbers, you should be good.

Based on the images, I believe your tax band may also be saved as a string type instead of a numerical data type.

It may be best to use the multi-field I mentioned earlier and adjust all the necessary fields to be numbers all in one go. That will save you from having to adjust every formula or even multiple times in a single formula.

 

Im attaching a basic workflow that has some number fields that are input as strings. It shows how I used the multi-field formula to convert to the numbers.

 

HScreenshot 2026-01-15 103724.png

KWARD
Atom

Thank you so so much!! This has worked! Have an amazing evening! 

Beschriftungen
Top-Lösungs-Autoren