Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

New column based on another table content

Hi-

Problem

I have two tables, table 1 is the main 'master table' and table 2 is an update table.

Essetially data is recorded in table 2 as a change log and tracks updates made in the first table.

Table 1

Table 2

Solution

What I would like to be able to do is create a new column on table 1 that gives a true value if the Risk ID in table one is in Table 2.

This has to be an additional column to the table.

so something like 

R01TRUE
R02FALSE
R03FALSE
R04FALSE
R05FALSE
  
  • Anonymous , A new column in Table 1

     

    New column =

    var _cnt = countx(filter(Table2, Table2[ID] = Table1[ID]), Table1[ID])

    return

    if(isblank(_cnt), "Yes", "No")

2 Replies

  • Anonymous , A new column in Table 1

     

    New column =

    var _cnt = countx(filter(Table2, Table2[ID] = Table1[ID]), Table1[ID])

    return

    if(isblank(_cnt), "Yes", "No")

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks that works really well.