Forum Discussion

gcrespo's avatar
gcrespo
Helper I
2 years ago
Solved

Get calculated table from multiple tables

Hi everyone,

I have 2 different tables like the following ones:

 

  • Table 1:

client_id | client_name

1 | client_one

2 | client_two

3 | client_three

 

  • Table2:

tactic_id | tactic_name

TA0001 | tactic_one

TA0002 | tactic_two

TA0003 | tactic_three

TA0004 | tactic_four

 

I would like to get a calculated table like the following one:

 

client_name | tactic_id

client_one | TA0001

client_one | TA0002

client_one | TA0003

client_one | TA0004

client_two | TA0001

client_two | TA0002

client_two | TA0003

client_two | TA0004

client_three | TA0001

client_three | TA0002

client_three | TA0003

client_three | TA0004

 

The tables are not related in any way. I just want a calculated table that automatically puts all the tactics along with all the customers. Could someone please provide some help?

 

Regards,

Gabriel Crespo

  • Hi gcrespo 

    Would something like this help?

     

     

    MyTable = 
        SELECTCOLUMNS(
            CROSSJOIN(
                'Table1',
                'Table2'
            ),
            "client_name", [client_name],
            "tactic", [tactic_id ]
        )

     

     

2 Replies

  • Hi gcrespo 

    Would something like this help?

     

     

    MyTable = 
        SELECTCOLUMNS(
            CROSSJOIN(
                'Table1',
                'Table2'
            ),
            "client_name", [client_name],
            "tactic", [tactic_id ]
        )