In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Solved: Multiply each digit of the 12 digit number one by one

GalegO
7 - Meteor

Hi community, 

 

I'm new at Alteryx and I need to replicate a formula but I didn't found any solution yet.

 

I need to multiply each digit from a field to generate two security control numbers.

 

In this field I have 12 digits Eg.: 111222333444 and I need to multiply each one individually and at final this field will have 14 digits Eg. 11122233344400

 

I attached a exemple code of what I need, because reading a code is more simple than explain all the rules.

 

PS: I know how to do the most part of these rules, but I can't figure out how to do this math of each digit in Alteryx.

 

Thanks in advanced.

2 REPLIES 2
mccartycp
7 - Meteor

Here is a possible solution. A bit clunky, but I believe it would do the trick.

 

mccartycp_0-1575650992730.png

GalegO
7 - Meteor

Thanks mccartycp!

 

You helped a lot giving me a North and I was able to do the logic, it's ugly for now, but it did the task.

 

GalegO_0-1575667576405.png

 

EDIT: I changed a little, now the solution can be attached at a workflow, the first version was to one number only.

 

EDIT 2: I appreciate if someone could try to do this same logic in a better and optimized version, so I can learn the best way to do some things. Thanks.

 

EDIT3: Just to help the search, this workflow is to calculate the two security digits for CNPJ. Each company in Brazil have this unique ID generated by Brazilian government and this workflows calculate the last two security digits.

Labels
Top Solution Authors