Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Move / Update Multiple Fields At Once

AndrewKwast
7 - Meteor

I have a sets of data where the order in which the codes are entered matter, that is to say, column 1 should always contain the first code, column 2 should always contain the second code, etc. However, the code itself takes up three columns, so that means I need to update three columns at once if I want to move the codes around.

 

Below is a sample of what I am trying to accomplish. I want to move all the values to the left so that Code 1 fields are always filled before Code 2 fields, and Code 2 fields are always filled before Code 3 fields.

 

I have considered using a bunch of expressions in the formula tool but I was hoping there could be an easier way. I have also considered using the multi-field formula tool, but I don't think it works since each field is updated based on a different expression.

 

 

Before:

TYPE1CODE1MISC1TYPE2CODE2MISC2TYPE3CODE3MISC3
A37039B90918H31156
B30767   K63015
   G66357M17242
      J45491
B81360      
D10591B95776   

 

Desired Result:

TYPE1CODE1MISC1TYPE2CODE2MISC2TYPE3CODE3MISC3
A37039B90918H31156
B30767K63015   
G66357M17242   
J45491      
B81360      
D10591B95776   

 

Let me know your thoughts! Thanks!

3 REPLIES 3
MarqueeCrew
20 - Arcturus
20 - Arcturus

@AndrewKwast,

 

@BenMoss answered a "shift left" post https://community.alteryx.com/t5/Alteryx-Designer-Discussions/Shift-all-data-to-the-left-if-there-is... the other day that describes a solution similar, if not equal to what I would recommend.  

 

Please try it and let's see if it doesn't do exactly what you want.

 

Cheers,

 

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
AndrewKwast
7 - Meteor

What if the MISC code below is optional?

In this case, the space in the third position may be correct.

How would the solution change in this case to ensure that, if the Type and Code are populated, the Misc code is ok blank?

 

Before:

TYPE1CODE1MISC1TYPE2CODE2MISC2TYPE3CODE3MISC3
A37039B909 H31156
B307    K63015
   G66357M17242
      J45491
B81360      
D105 B95776   

 

After:

TYPE1CODE1MISC1TYPE2CODE2MISC2TYPE3CODE3MISC3
A37039B909 H31156
B307 K63015   
G66357M17242   
J45491      
B81360      
D105 B95776   
AndrewKwast
7 - Meteor

I did a quick fix by adding then removing a placeholder for the optional third value.

 

E.g.

TYPE1CODE1MISC1TYPE2CODE2MISC2TYPE3CODE3MISC3
A37039B909 ***H31156
B307 ***K63015   
G66357M17242   
J45491      
B81360      
D105 ***B95776   
Labels