12 Replies Latest reply on Jun 9, 2017 11:46 AM by Michael Gillespie

    Calculation Age using primary and secondary data source fields

    James Tanner

      Hey everyone, I have a primary datasource a secondary datasource connected on a Client ID. In my secondary datasource is the clients Birthdate. I am trying to do a "DATEDIFF" function in order to calculate the clients age using Birthdate and another date that resides in my primary datasource. Why calculation is below:

       

      DATEDIFF('year',ATTR([CIS_100_CLIENT (CORIS)].[Birth Date]),[Release Date])

       

      Tableau puts ATTR before the Birthdate and i am getting this error "cannot mix aggregate and non-aggregate functions in a calculation".

       

      I have tried removing ATTR and i get another error "all fields must be aggregate or constant when using table calculation functions or fields from multiple data sources"

       

      Does anybody know how to get around this?

       

      Thanks,

      James