Forum Discussion

HagosHagos's avatar
HagosHagos
Qrew Member
3 years ago

If I'm using a shared value from field #1 in field #2 (different tables), how can I link them?

Good morning QuickBase Community,

Question: If I'm using a shared value from field #1 in field #2 (different tables), how can I link them?

Your help here would be greatly appreciated. I am a Data team of one!

I currently have two tables in quickbase –

  • An employee table (built already)– where each employee gets a row with their demographic info. Primary Key: Each individual's User ID
  • A managers table– where each employee gets a row for every manager they had. A manager will always be an employee.

I have the tables set up successfully (down to each manager being associated with an employee user ID from shared values) except I'd like to be able to link each manager to its corresponding employee table record (e.g., if Hagos is a manager, his manager record is linked to his employee table data).That way, I can pull relational things like what's highlighted and do other things that rely on relationships (e.g., drilldowns, counting the # of direct reports a manager has).

Employee Table

Employee Name

User ID

Race

Gender

Current Job Title

# Direct Reports

Jason

910

Black or African American

Male

QuickBase Specialist

2

Person 1

139

White

Female

QuickBase Specialist

 

Managers Table

Employee Name

Manager User ID (this is currently a multiple choice text shared value from employee name)

Manager Name (this is currently a formula that pulls name from user id from the employee table)

Manager Race (pulls from the employee table using the User ID)

Person 1

910

Jason

Black or African American

Person 1

911

Ronnie

 

Person 1

912

Kayla

 

Person 2

910

Jason

 

 

 Thank you so much,

Hagos



------------------------------
Hagos Hagos
------------------------------
  • I rarely recommend this, but your situation is one use case where I find a looping relationship makes the most sense. A looping relationship is a relationship where there is only 1 table. So, your Employee table would have a relationship to itself. Once you've done that, you'll have a field called 'Related Employee' and you can just change the name to 'Related Manager' or something similar. This way, you would simply select the current Manager for that Employee.

    Alternately, you could have something a bit more complex where you would be able to track the Employee's growth with the company. For this, I would setup 3 tables:
    • Employees
    • Roles
    • Role Assignments
    For the relationships, Employees and Roles would both be parent tables to the Role Assignments table, with Employees needing 2 relationships - one for the actual Employee and one for the Manager.

    ------------------------------
    Blake Harrison
    bharrison@datablender.io
    /
    ------------------------------
  • I rarely recommend this, but your situation is one use case where I find a looping relationship makes the most sense. A looping relationship is a relationship where there is only 1 table. So, your Employee table would have a relationship to itself. Once you've done that, you'll have a field called 'Related Employee' and you can just change the name to 'Related Manager' or something similar. This way, you would simply select the current Manager for that Employee.

    Alternately, you could have something a bit more complex where you would be able to track the Employee's growth with the company. For this, I would setup 3 tables:
    • Employees
    • Roles
    • Role Assignments
    For the relationships, Employees and Roles would both be parent tables to the Role Assignments table, with Employees needing 2 relationships - one for the actual Employee and one for the Manager.

    ------------------------------
    Blake Harrison
    bharrison@datablender.io
    /
    ------------------------------