8 Replies Latest reply: Apr 9, 2018 3:22 PM by Rohit Thete RSS

    Aggr Function - Help Needed

    Rohit Thete

      Hello,

      I am new to Qlik Sense.  

      I am trying to use aggr function but I am not getting the correct result.  

       

      count(distinct( 

      if(  Aggr(Sum(TotalRevenue_INV),AcctExecName,Year_Month_Policy_Eff_and_Acct_Eff_Merged)>=2000 and Is_Contributing_AE=1 and Policy_Eff_and_Acct_Eff_Merged >= AddMonths(Monthstart(Today()),-12) and Policy_Eff_and_Acct_Eff_Merged < AddMonths(Monthstart(Today()),0), AcctExecName 

      )))  

       

      Using the above statement, I am getting the correct counts of AcctExecName field but when I try to get the revenue for the same AcctExec field using the statement below I am not getting the correct result.  

      Can you please help me understand what I am doing wrong?    

       

      Sum( 

      if(  Aggr(Sum(TotalRevenue_INV),AcctExecName,Year_Month_Policy_Eff_and_Acct_Eff_Merged)>=2000 and Is_Contributing_AE=1 and Policy_Eff_and_Acct_Eff_Merged >= AddMonths(Monthstart(Today()),-12) and Policy_Eff_and_Acct_Eff_Merged < AddMonths(Monthstart(Today()),0), TotalRevenue_INV 

      ))  

       

      Thank you in advance.