Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Want to add a synamic formula for addition by splitting alphabetical charcters from a valu

Pankaj_G
7 - Meteor

Hi so this is my input and expected data below

 

Input Data tableExpected Output
500MG/250MG750
10MG/75MG/2MG87
10MG/75MG/2MG87
1000MG/125MG1125

 

In this i have dynamic scenario i could have n number of seperation with slash like 10MG/10MG/10MG/10MG/10MG so i should get the output 50 in the next column and i could also have scenario like not having MG on all sides it couls be like this 10MG/10IU/10MG/10PC i should get 40 in the output column

 

i cant use dei iter here as it wou;d be very messy as i do not know in how many columns it would scatter so please help

3 REPLIES 3
cjaneczko
13 - Pulsar

Try this.

 

Edit: i noticed that the MG could be anything so please use the most recent workflow i saved below. I updated the formula to be the following.

 

 

REGEX_Replace([Input Data table],"[A-Za-z]","")

 

 

image.pngimage.png

Brando
8 - Asteroid

@Pankaj_G

 

This is really simple if you use the regex tokenize split to rows method, then summarize tool to group by record id and sum the values. See the attached workflow and it'll clear up, literally just three tools!

Pankaj_G
7 - Meteor

Thanks cjaneczko, i guess your solution would be the correct one, since i could have multiple alphabets apart from MG and i think using this approach i will be able to replace other alphabets as well and also will be able to do the sum function.

Labels
Top Solution Authors