Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
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