Forum Discussion

malex30's avatar
malex30
Frequent Visitor
2 years ago
Solved

How do I create a relationship between two tables with the three matching columns. (1 to 2 ratio)

I have two tables I want to connect.
1. 'Audit - HSE'

2. 'Contact'

 

the 'Contact' has a column [id]

the 'Audit - HSE' has two columns 'Contact'[id] can connect to i.e. [Supervisor, Day] and [Supervisor, Night]

 

I want to be able to connect these two tables and show the rows as a table visual. The results should show both the rows that the 'Contact'[id] matches either column.

The end result I want to perform is be able to make calculations and show tables and graphs from the results in filtering 'Contact'

For some reason I feel like I might be overthinking the solution. However, I would also like to be able determine if the 'Contact'
was either the Day or Night supervisor. (This is not as important)

 



amitchandak parry2k Ritaf1983 

3 Replies

  • malex30 select all other columns except these two and then unpivot other columns.

  • malex30 what you need to do is unpivot the audit table, select all the columns except the day, and night columns, right-click, and unpivot other columns. You will get two columns, attribute and value. Rename attribute to Shift and Value to Id. close and apply.

     

    Now you have one relationship with the Contact table, visualize the way you want and if you want, you can filter on the Shift column to get only day or night.

     

     

    • malex30's avatar
      malex30
      Frequent Visitor

      This is what I did. parry2k 

      Result:

       

      Is this what your meant? I'm a little confused on If I did this correctly and how this works?