Forum Discussion

pedroccamaraDBI's avatar
pedroccamaraDBI
Post Partisan
6 years ago
Solved

Concatenate

Hi everyone,
Is there a way of joinning 2 columns from different tables, but related? I'd like to concatenate prodCode from Tab Sales with product from Tab Products.
Can you help?
Thanks in advance
Pedro

  • If they are related  through a one-to-many connection (say table A annd table B), go to the B table and add a new column:

    Concatenate = 'B table'[column1] && related(A table[column2])

  • FarhanAhmed's avatar
    FarhanAhmed
    6 years ago

    Since Product contains 1 Value and Sales Contains Multiple Values therefore Reference Column will be created on Many Side because it will return 1 value from product. In this case you should create column in Sales Table rather than in Product Table. 

     

    Rule of thumb, reference column will always create on Many Side

4 Replies

  • AliceW's avatar
    AliceW
    Power Participant

    If they are related  through a one-to-many connection (say table A annd table B), go to the B table and add a new column:

    Concatenate = 'B table'[column1] && related(A table[column2])

    • pedroccamaraDBI's avatar
      pedroccamaraDBI
      Post Partisan

      Hey FarhanAhmed
      I've tried to add that column, on the products table, cose in sales table i only have product code, and i want to see the name of the products and i couldn't because it "asks" me the column name....not a table and column name, you know?
      Am i doing something wrong? (dum question)
       

      • FarhanAhmed's avatar
        FarhanAhmed
        Community Champion

        Since Product contains 1 Value and Sales Contains Multiple Values therefore Reference Column will be created on Many Side because it will return 1 value from product. In this case you should create column in Sales Table rather than in Product Table. 

         

        Rule of thumb, reference column will always create on Many Side