Forum Discussion

chriswragge's avatar
chriswragge
Helper I
8 years ago
Solved

Pivot two tables

Hi there, 

 

I'm not sure if my subject line describes accuratly what I am trying to do, but I would like a query to turn Table A and Table B, into Table C.

 

A & B are single column tables with no values.

 

Table A

1

2

3

 

Table B

x

y

 

Table C

1 x

1 y

2 x

2 y

3 x

3 y

  • Hi chriswragge

    In edit queries, add a Custom Column to create a Cross Join.

    Open TableA, create a custom column using TableB,

     

    After you click OK, you get a new column that “contains” the entire TableB as an object in each row of the TableA (as shown above).

    Then all I needed to do then is expand the new column by clicking the expand button (shown above) to create all the possible combinations (shown below)

     

    Best Regards

    Maggie

2 Replies

  • v-juanli-msft's avatar
    v-juanli-msft
    Community Support

    Hi chriswragge

    In edit queries, add a Custom Column to create a Cross Join.

    Open TableA, create a custom column using TableB,

     

    After you click OK, you get a new column that “contains” the entire TableB as an object in each row of the TableA (as shown above).

    Then all I needed to do then is expand the new column by clicking the expand button (shown above) to create all the possible combinations (shown below)

     

    Best Regards

    Maggie