Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Calculate due date based on relationship

Been struggling with this one. Hope you might help! πŸ™‚

 

I have two tables: one holds historical data about employees trainings (tab_Historico) and the other one is my relational table (dTreinamentos), where I keep the training codes and its particularities (like Due Date in number of days, "[Validade_Dias]").

 

What I need to do is SUM the number of days to expiry from dTreinamentos[Validade_Dias] to tab_Historico[_DataConclusao], making sure I only get the latest correspondence to the [Concat_Historico] (id).

Tables:

The primary-key is "Concat_Historico" and "Concat".

tab_HistoricodTreinamentos

 

6 Replies

  • az38's avatar
    az38
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 

    as you have relationships why dont you try a very simple statement like

    DueDate = [_DataConclusao] + [Validade_dias]

    • Anonymous's avatar
      Anonymous
      Not applicable

      az38, it doesn't work, since [Validade_Dias] is a calculated column from [Validade_Anos].

       

      Validade_Dias = [Validade_Anos] * 365

       

      • az38's avatar
        az38
        Icon for Community Champion rankCommunity Champion

        Anonymous 

        i don't see why it doesn work if it is a really column, not a measure

        and what your desired output? give an example

  • v-lionel-msft's avatar
    v-lionel-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

     

    Could you use columns like [_user] to create a table relationship as 1: 1?

     

    Best regards,
    Lionel Chen

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