If I have number 12345, is there a way to make a new field that's 1+2+3+4+5 = 15?
A little round about but:
Add a record id
Use a regex tool to split to rows for each digit
Summarise grouping by record id, summing digit
Join back to original and your done
Sample attached
@Amy_C,
Please consider this also a solution. I chose to provide an alternative answer to the one that @jdunkerley79 gave you. Mine is no more correct, it just gets you there with a single formula tool. I assume that the string that is the source is no longer than 11 digits. You can extend if needed (or shorten). The formula works for 12345 as well as 999999999999.
ToNumber(substring(ToString([Value]),0,1))+ToNumber(substring(ToString([Value]),1,1))+ToNumber(substring(ToString([Value]),2,1))+ToNumber(substring(ToString([Value]),3,1))+ToNumber(substring(ToString([Value]),4,1))+ToNumber(substring(ToString([Value]),5,1))+ToNumber(substring(ToString([Value]),6,1))+ToNumber(substring(ToString([Value]),7,1))+ToNumber(substring(ToString([Value]),8,1))+ToNumber(substring(ToString([Value]),9,1))+ToNumber(substring(ToString([Value]),10,1))
This is the way that the naked eye will add the numbers.
Cheers,
Mark
Both solutions work wonderfully. Thank you!
Not sure why this is happening. Tried to open the solution by jdunkerley79 and this message came back:
Alteryx says I am running the latest version.
What is the problem?
Its was written in 11.3
I have changed the version back to 10.5 and attached.
Hi @derekbelyea,
The latest version is 11.3... that's the version that James created his workflow in. Only came out mid-last week.