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.

Merge two columns of different size

StuttgartPower
6 - Meteoroid

I have two input columns, which I need to bring together as follows:

                   

Input Column 1Input Column 2Output Column 1Output Column 2
AA1AA1

B

A2AA2
CA3AA3
 B1BB1
 B2BB2
 B3BB3
 C1CC1
 C2CC2
 C3CC3

 

Can you help me to get this output?

15 REPLIES 15
morr-co
10 - Fireball

Hi @StuttgartPower  - if I am understanding correctly, you should be able to update the value of Input Column 1 using the following function in a Formula tool.

 

 

Left([Input Column 2], 1)

 

StuttgartPower
6 - Meteoroid

Not quite the solution I am looking for. In principle I would like, that it maps certain rows of input-column 2 to certain rows of input-column 1

atcodedog05
22 - Nova
22 - Nova

Hi @StuttgartPower 

 

The exact logic is unclear but @morr-co suggested you should be able to get the expected output using left.

 

Here is a workflow for the task.

Output:

atcodedog05_0-1606228532756.png

Workflow:

atcodedog05_1-1606228551076.png

Hope this helps 🙂 Feel to ask if you have any questions

StuttgartPower
6 - Meteoroid

Thank you! But what if instead of A, B, C there were completely different terms like Tier3648, Wave375, Fly894, then the workflow would not work, would it?

atcodedog05
22 - Nova
22 - Nova

Hi @StuttgartPower 

 

Sorry i didnt see your previous post.

 

Are these columns from different data source. 

morr-co
10 - Fireball

Do you mean that you want to retain the value of Input Column 1 if a value already exists in it? That would look like this:

 

IIF(IsEmpty([Input Column 1]), Left([Input Column 2], 1), [Input Column 1])
StuttgartPower
6 - Meteoroid

Yes, from different data sources

morr-co
10 - Fireball

I just saw your updated example. I've attached a way that you could extract the leading alpha characters with a regex tool.

 

Screen Shot 2020-11-24 at 7.44.54 AM.png

StuttgartPower
6 - Meteoroid

Excuse me, I have expressed myself far too vague. Hopefully now more clearly. My intention is to get 2 inputs together to one output and to map different lines of input 2 to certain lines of input 1

 

Input-Data-Source 1

Column 1

Tier987
Wave285
Fly937

 

Input-Data-Source 2

Column 1
A1
A2
A3
B1
B2
B3
C1
C2
C3

 

Output-Data

Column 1Column 2
Tier987A1
Tier987A2
Tier987A3
Wave285B1
Wave285B2
Wave285B3
Fly937C1
Fly937C2
Fly937C3

 

Labels
Top Solution Authors