1 Reply Latest reply on Dec 16, 2013 10:07 PM by . Indumon

    IF Statement on Select Dimension with COUNTD Values

    Jamie Falik

      I am trying to run a calculation that divides the values of 'Presocio' by 2 across multiple categories while keeping all the other values the same. For example, the starting value for 'Presocio' would be 27 instead of 54. 

       

      The values displayed below are distinct counts on Member IDs.

       

      Capture.PNG.png

       

       

      Here's my calculation:

       

      IF ATTR ([Estatus Membresia]) = 'Presocio'

       

      THEN COUNTD([Numero_Membresia])/2

       

      ELSE COUNTD([Numero_Membresia])

       

      END

       

      I am looking for advice on getting this calculation to work. 

        • 1. Re: IF Statement on Select Dimension with COUNTD Values
          . Indumon

          Hi Jamie,

          Above calculation should work. I have tested the logic with superstore sample and it is working fine.

           

          If Attr([Region])='East'// 
          then Countd([Item])/2
          Else Countd([Item]) End
          

           

          //if you only want to divide first column of East by 2 then

          If Attr([Region])='East'And first()=0 then Countd([Item])/2 Else Countd([item]) End

           

          output:Original East countd

          Screen.png

          East after countd()/2

          Screen.png

           

          Can you explain the issue you facing?

           

          -Indumon