This is an example of my data set
Account
number Name1 Name2
1 A B
2 A
3 B
4 C D
5 C
6 D
7 D
This is what the output needs to be
Account Portfolio Portfolio
number ID size
1 1 3
2 1 3
3 1 3
4 2 4
5 2 4
6 2 4
7 2 4
My query is about linking accounts and creating output to summarise this. In this case here A is linked to 2 accounts and B is linked to 2 accounts but because they share one account the portfolio size (in the 2nd table)will be 3 and the unique id for that group of customers will be 1. Make sense.
Trying to write a piece of code that converts table 1 to table 2. I've tried a series of counters and do loops but as of yet, no success. Does anyone have any thoughts?
Account
number Name1 Name2
1 A B
2 A
3 B
4 C D
5 C
6 D
7 D
This is what the output needs to be
Account Portfolio Portfolio
number ID size
1 1 3
2 1 3
3 1 3
4 2 4
5 2 4
6 2 4
7 2 4
My query is about linking accounts and creating output to summarise this. In this case here A is linked to 2 accounts and B is linked to 2 accounts but because they share one account the portfolio size (in the 2nd table)will be 3 and the unique id for that group of customers will be 1. Make sense.
Trying to write a piece of code that converts table 1 to table 2. I've tried a series of counters and do loops but as of yet, no success. Does anyone have any thoughts?