2 Replies Latest reply on Mar 30, 2017 7:23 AM by Tim Cady

    Calculating aggregate & non-aggregate

    Tim Cady

      Hi all,


      I'm struggling with a calculated field I'm trying to make and hoping someone can help me out.Basically, I'm trying to sum a dollar amount based on a specific critirea (in this case the outcome of a phone call). Here's what I thing I need....


      IF [Call Outcome (Outcomes)]='Outcome 1' THEN SUM([Premium])

      ELSE 0 END


      The error I keep coming back with is that I cannot mix aggregate and non-aggregate comparisons. Is there any work around?

        • 1. Re: Calculating aggregate & non-aggregate
          Kaz Shakir


          Try changing your calculated filed to:


          IF [Call Outcome (Outcomes)]='Outcome 1' THEN [Premium]

          ELSE 0 END


          Then when you place the calculated field on a viz, you can aggregate it using SUM.


          A calculated field will effectively create a new column in your data, that contains a value for each row of your data.  Meaning that even rows where the Call Outcome is not equal to 'Outcome 1' will still have a value (in this case the value will be 0).  After that new column is created, you can treat it like any other column and sum it, or max it, or min it, etc.


          If you can post a sample of the data and what you are trying to achieve, we can probably help with more ideas.


          1 of 1 people found this helpful
          • 2. Re: Calculating aggregate & non-aggregate
            Tim Cady

            Thats seems to have done it. Thank you, I figured I was thinking about this too hard.