Alteryx Designer Desktop Discussions

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

conditionally copy and insert rows

OJet
7 - Meteor

Hi Alteryx  Gurus, 

 

Would you have an idea how to accomplish  a task like this: 

Input data:

a0
b2
c0
d0
b0
e1
f0
b0
e0

 

Needed output:

a0
b2
c0
d0
b0
c0
d0
e1
f0
b0
c0
d0
e0
f0

 

Because number 2 corresponds to letter b, the next two rows of data need to be copied and inserted underneath each occurrence of b. 

In the whole dataset, no matter how many times b would be listed - only one case might have a corresponding number other than 0, so no conflict with different values of b is expected. Same concept for e: because corresponding number is 1 - the following 1 record needs to be inserted underneath each occurrence of e

Can something like this be solved with Alteryx?

 

Thank you!

3 REPLIES 3
ArtApa
Alteryx
Alteryx

Hi @OJet - Here is how you can do this:

ArtApa_0-1648612918638.png

 

Tyro_abc
11 - Bolide

hi

 

This is my version. I am sure this can be simplified. 

 

Tyro_abc_0-1648614905681.png

 

Regards

Arundhuti

OJet
7 - Meteor

@Tyro_abc , @ArtApa  Thanks a lot to both of you, great solutions and  I learned a lot by looking at how you approached this

Labels