7 Replies Latest reply on Apr 30, 2018 8:40 AM by william Mar

    Calculated field error using secondary data source

    william Mar

      Hello,

      Hope somebody can help me with fixing a formula in a calculated field related to aggregation and multiple data sources. I am bit stuck :-(.

       

       

      Situation
      I am making use of 2 data sources, and when I am using a Measure of the Secondary data source I receive error messages about aggregation:


      "Cannot mix aggregate and non-aggregate comparisons or results in 'IF' expressions"
      OR
      "All fields must be aggregate or constant when using Table calculations or fields from multiple sources"

       

      I tried to wrap the field in aggregations, but i still receive a error message that the fields must be constant.

       

       

      Formula

      SUM
      (IF [Date Filter Current Period] = True
      THEN
      SUM([Sheet1 (google analytics_example)].[Sessions])
      END)

       

      See also attached a workbook with an example. In the workbook you can find the calculated field(s) with the issue (e.g. "Current Period Sessions (HOW?)")

       

      Thanks!