This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
General Discussions has some can't miss conversations going on right now! From conversations about automation to sharing your favorite Alteryx memes, there's something for everyone. Make it part of your community routine!
Hey guys, I'm struggling with this operation in Alteryx and I would be very grateful if someone could help me. I tried to use formula, multi-field formula, multi-row formula but couldn't make it so far.
It is just a meaningless example below, but I want to duplicate columns from A to C, giving them a new name (in the example newA, newB and newC) and shifting them down like this:
newA = A shifted down by 0 cell
newB = B shifted down by 1 cell
newC = C shifted down by 2 cells
and so on...
Also, where might be Blanks or Nulls in consequence of the shifting, I want to put a 0.
Before
Name | A | B | C |
Name1 | 1 | 6 | 11 |
Name2 | 2 | 7 | 12 |
Name3 | 3 | 8 | 13 |
Name4 | 4 | 9 | 14 |
Name5 | 5 | 10 | 15 |
After
Name | A | B | C | newA | newB | newC |
Name1 | 1 | 6 | 11 | 1 | 0 | 0 |
Name2 | 2 | 7 | 12 | 2 | 6 | 0 |
Name3 | 3 | 8 | 13 | 3 | 7 | 11 |
Name4 | 4 | 9 | 14 | 4 | 8 | 12 |
Name5 | 5 | 10 | 15 | 5 | 9 | 13 |
Solved! Go to Solution.
Hi @bruno_ ,
EDIT : missed the shift part
One way would be with a multi-field formula tool
Regards,
Angelos
Ok, it works for the duplication, but what about the conditional shifting?
Hi @bruno_
I'm not sure you are responding to my post or the one above. But for the solution I provided, did I get the shifting logic incorrectly?
Pedro.
Thanks guys @AngelosPachi and @pedrodrfaria.
Your worfklow worked, Pedro.
I just have another issue: what if the number of columns are bigger? I have to do this operation in dozens of columns and with this program I would have to use the Multi-row formula tool dozens of times. Is there any other way?
Hi @bruno_ ,
Sorry for missing that, here is a better solution than the one I provided earlier. This one actually does what you have asked, and will work for any number of columns.
Cheers,
Angelos
Thanks!!