2 Replies Latest reply: Aug 4, 2015 1:07 PM by Liam Do RSS

    Calculate Result In If Statements Problem

    Liam Do

      Hi All,


      I am having problem with calculating result from two expressions in the if statement. Please help!!


      Here is what I have:


      The count_intervals is calculated by orange expression. Now, I need to take the total sum (12) of this count_intervals divide it by 18 for each % Core Intervals Met SL Goal where count_intervals equals 1.


      This expression does not return correct result as you can see in the picture below.

      if((Sum (met_core_sl))/(Sum (answered_call))>.8, (sum(total(if((Sum (met_core_sl)/Sum (answered_call))>.8, 1,0))))/18,0)



      If I replace the orange expression with below, it returns all zeros instead of dashes.

      if((Sum (met_core_sl))/(Sum (answered_call))>.8, sum(total(count_intervals))/18,0)


      Thank you for your input everyone.

        • Re: Calculate Result In If Statements Problem
          Stefan Wühl

          I think you need advanced aggregation here to embed your Sum() aggregations into another Sum() aggregation.


          Look into advanced aggregation examples into the help, like 'Sum of rows in pivot tables' (even if you are not using a pivot table).


          You are not showing full information about your chart, like the dimensions used (it's in general much easier to help if you post a small sample qvw). I am assuming a single dimension called Dim1. Then your expression might look like


          if((Sum (met_core_sl))/(Sum (answered_call))>.8,

          Sum(total aggr( if((Sum (met_core_sl)/Sum (answered_call))>.8, 1,0) , Dim1 )) /18


          • Re: Calculate Result In If Statements Problem
            Liam Do

            Thanks Swuehl! That's what I want.