5 Replies Latest reply on Sep 15, 2016 11:36 AM by antonio.bayona.0

    Using Max Date for MTD calc in Secondary Data Source

    antonio.bayona.0

      Hello,

       

      I have a data blend for two data sources and I want to use the max date of a date field in the primary source to drive a month to date calculation in the secondary. When I use the formula below as a stand alone in the secondary source I get close to the result I want but need to replace "Today()" with Max Date from the primary source as date. This calc wont allow that because of course Max Date from primary comes over as and ATTR and AGG. Tried several other options.  

       

      Anyone know a way to apply the max date here?

       

      IF

          (DATETRUNC('month', [date]) =

          DATETRUNC('month', TODAY())

          AND

          DATETRUNC('day', [date]) <=

          DATETRUNC('day', TODAY()))

      THEN

          ([Units])

      END