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.
Gelöst! Gehe zu Lösung.
@KWARD Your PAY Tax variable is string type, change to double , apply the same for all the other numerical fields
Can you check the [Tax Band] and [Home to work] fields are double data type ?
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
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
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.
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
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.
H
Thank you so so much!! This has worked! Have an amazing evening!