Forum Discussion

mxblaise's avatar
mxblaise
Regular Visitor
8 years ago
Solved

Calculated column from two different tables

Hello,   There are several post about this topic but I really don't get the logic. I have two tables feeded by two different files, so two corresponding tables.   OperationsTable : Serial O...
  • Greg_Deckler's avatar
    8 years ago

    I believe that this will work:

     

    Column = DATEDIFF([NDT date],MAXX(FILTER(RELATEDTABLE(OperationsTable),[Operation]="Injection"),[Operation date]),DAY)

    What this is doing:

     

    RELATEDTABLE - brings back all related records from OperationsTable

     

    FILTER - Filters the results from RELATEDTABLE to just those whose [Operation] is "Injection"

     

    MAXX - Grabs the MAX out of a table, could use any aggregation

     

    DATEDIFF takes the difference in days between the two dates