Forum Discussion

HFarnes's avatar
HFarnes
New Member
8 years ago
Solved

Help Needed: Finding which ID number is in a different table

Hello

 

I am in need of some help

 

I have two tables Contacts and Courses. I need to find out which ID Numbers from the Contacts Tabel are in the Courses Table in a True/False formate. Which will then allow me to make a table visual to show a list of ID numbers that are True and those that are false.

 

I have tried a couple of different things, but nothing is working.

 

Any Help would be appreciated! 

  • Hi HFarnes.

     

    My comments assume that you have two tables (which I'm labelling "Table1" and "Table2") both containing a numeric field called "ID".

     

    If the tables are related, i.e. you have a relationship between the ID fields for both, just create a calculated column as:

     

    Found = NOT(ISBLANK(RELATED(Table2[ID])))

     

    The example above should be put on Table1 and returns TRUE if the ID is found on Table2. You can revert the way around and get the same result for Table2.

     

    Let me know if you DON'T have a relationship between the IDs, because in that case the solution is different.

    Regards.

2 Replies

  • Hi HFarnes.

     

    My comments assume that you have two tables (which I'm labelling "Table1" and "Table2") both containing a numeric field called "ID".

     

    If the tables are related, i.e. you have a relationship between the ID fields for both, just create a calculated column as:

     

    Found = NOT(ISBLANK(RELATED(Table2[ID])))

     

    The example above should be put on Table1 and returns TRUE if the ID is found on Table2. You can revert the way around and get the same result for Table2.

     

    Let me know if you DON'T have a relationship between the IDs, because in that case the solution is different.

    Regards.

    • MarcoRotta's avatar
      MarcoRotta
      Icon for Resolver I rankResolver I

      Just adding the option if the two ID fields do NOT have a relationship.

       

      Found = ISNUMBER(CALCULATE(COUNT(Table2[ID]);FILTER(ALL(Table2[ID]);Table2[ID]=Table1[ID])))

       

      This is a little bit trickier, but works like a charm. And of course there are other ways to do that "CALCULATE", and some colleagues here might disagree of my approach.

       

      Regards.