Forum Discussion

dudeyates's avatar
dudeyates
Frequent Visitor
5 years ago
Solved

Add New Column That Retrieves Value From Another Table

Hi all,   I have two tables. They are not linked by a relationship. Table 1 has billed timecard entries Table 2 is position data The goal is to classify each labor hour entry as student, tempo...
  • FrankAT's avatar
    5 years ago

    Hi dudeyates ,

    you can do it like this:

     

    position_type = 
    VAR _Table =
        FILTER (
            Table2,
            Table1[emp_id] = Table2[emp_id]
                && Table1[work_date] >= Table2[start_date]
                && Table1[work_date] <= Table2[end_date]
        )
    RETURN
        MINX ( _Table, Table2[position_type] )
    

    With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
    FrankAT (Proud to be a Datanaut)