Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Fetching Id from another table

Hi,

I have a issue that I have been trying to solve but couldnt get around it. 

I have  2 tables, table A and table B.

Columns for table A:

Name                         Id                 Subname        

Jason                                                G1

Mark                                                 G2

Jason                                                G3

Eason                                                G4

 

Example for table B:

Id                             Owner                   

268                          Jason                      

64                            Jason

45                            Eason

34                            Mark

 

The end result for table A should be:

Columns for table A:

Name                         Id                          Subname

Jason                          268                       G1

Mark                           34                         G2

Jason                          64                         G3

Eason                          45                        G4

 

The relationship between table A and table B is many-to-one relationship.

I have tried making the Id column in table A as a calculated column and using this formula.

Id = SWITCH([Name],[Name],IF([Name]==tableB[Owner], tableB[Id])) , but I dont get the dropdown listing for tableB. 
 
Is there anywhere that i am doing this wrong? 
 
Any help is appreciated. Thanks
  • Sub Name on table B would get you to a key column (the name and sub name together) that you could do a LOOKUPVALUE on.

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

    The system does not recognize duplicate values. For each value corresponding to two results, the following four scenarios occur

     

     

    If there are 2 rows with the same name in table B, you should add another condition for the duplicate value to differentiate

     

     

    Best Regards

    Community Support Team _ Polly

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

  • Anonymous 

    Based on just the name in table A, how is the system supposed to know which Jason is the correct one?

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks for your feedback. It made me re-think my problem. My thought process is if there are 2 rows with the same name from table B, the system should populate table A with two different ids for each row with the same name. 

    Or should i re-look this to introduce another key in table A and table B to make it distinct?

     

  • Sub Name on table B would get you to a key column (the name and sub name together) that you could do a LOOKUPVALUE on.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    The system does not recognize duplicate values. For each value corresponding to two results, the following four scenarios occur

     

     

    If there are 2 rows with the same name in table B, you should add another condition for the duplicate value to differentiate

     

     

    Best Regards

    Community Support Team _ Polly

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.