4 Replies Latest reply: Jul 25, 2018 1:25 AM by Asfand Butt RSS

    Confusion with using Sum function for different units

    Asfand Butt

      Hi,

       

      i have the following expression that is causing some issues in Count.

      Sum({<TransDate={'>=$(=MonthStart(today(),-12))<=$(=MonthEnd(today(),-1))'}>}$(UnitValue))

       

      $(UnitValue) is a variable that either passes 1 or a value of TEUs e.g. if($(vUnits)=0,TEUs,1)

       

      In case of passing TEUs the sum comes perfect whereas while passing 1, i just want the sum function to behav like count function and just gives a count of all rows but its giving a bigger count than it should be. My problem is i have to stick with Sum in my expression.

       

      Any suggestions?

       

      Thanks,