Alteryx Designer Desktop Discussions

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

Join tables by text that contains

FraM
6 - Meteoroid

Dear Community, 

 

Aiming to calculate share of investors types (based on all active and former investors) for each company. As a first step for this, I would like to merge the two tables below. 

 

Table A: Companies with investor names

 

Company nameActive investor nameFormer investor name
Company1Investor1,Investor5Investor100,Investor2
Company2Investor1, Investor2...Investor20Investor1, Investor2...Investor20
....  
Company5000Investor51Investor3

 

Table B: Investors with investor types 

 

Investor nameInvestor type
Investor1Venture Capital
Investor2Private Equity
.......
Investor1000State

 

The manual way would be to 1) Split text within "active investor name" and "former investor name" columns to several columns by , 2) Join each column via investor name from the second table. But this way I have to perform tons of joins separately as I will end up with hundreds of new columns that need to be joined with second table to get "investor type" - so I was hoping there might be an easier way? 

 

Output table should look like this. If you think there is an easier way to calculate the share of investor types per company, I'm also open to alternative approaches! 

 

Company nameActive investor name 1Active investor name 1_type Active investor name 2Active investor name 2_type Former investor name 1Former investor name 1_typeFormer investor name 2Former investor name 2_type
Company1Investor1Venture CapitalInvestor5xxxInvestor100xxxInvestor2Private Equity

 

Many thanks in advance! 

3 REPLIES 3
Emmanuel_G
13 - Pulsar

@FraM 

 

Find in attachement the way of doing this. I did a test with first line of companies and the first two rows of investors.

 

Let me know if there is any issue and please, do not hesitate to mark this answer as solution if it helped. 🙂

 

Emmanuel_G_0-1664324646379.png

 

 

FraM
6 - Meteoroid

@Emmanuel_G 

 

Many thanks for your response! !The part of splitting the investor names to rows and transposing back works well.

However the join for the investor type only works for the specific investor selected via left join (e.g. "former investor 2" in your example). What I would need is a dynamic join to get a new field with the investor type for each active and former investor (some companies have up to 100 active or former investors).

 

Specifically for this example this would mean:

- If I add "Investor5" (which is the 2nd active investor of company1) with type "impact investor" to table B, I would automatically get a column with "active investor name2_ type" filled with "impact investor" in my output table.

- If I add "Investor100" (which is the 1st former investor of company1) with type "state investor" to table B, I automatically get a column with "former investor name1_type" filled with "state investor" in my output table

 

Do you have a suggestion how to build such a "dynamic join"? 

 

Christina_H
14 - Magnetar

@FraM What do you want the output to look like?  You can join while the data is vertical to get all investor types at once, then you just need to rearrange the output back to how you want it.

Christina_H_0-1664361637058.png

(Missing investor types are due to the test data being incomplete)

 

Edit: I've updated my workflow to put everything out sideways, which seems like what you need, see attached.

Christina_H_0-1664362989385.png

 

Labels