6 Replies Latest reply: Jun 18, 2015 11:56 AM by Grant Rosenthal RSS

    sum multiple selectable IF statements

      I am using the following to sum multiple fields, where each field can be selected or de-selected through a variable by the user. It seems to work correctly if all variables are set to 0, however as soon as one is de-selected I get null values. Im sure theres something small Im missing here.

       

      I have buttons setup for the three fields that toggle them to either 0 or 1, with the intent these be used by the operator to choose specific values to included.

       

      My expression is below:

       

      If( vFundTypeReal = '0',

      Sum(

        {$<[SUMMARY_DATE] = {">=$(vStartDate)<=$(vEndDate)"}>}

      HANDLE_REAL)

      )

      +

      If( vFundTypeReleased = '0',

      Sum(

        {$<[SUMMARY_DATE] = {">=$(vStartDate)<=$(vEndDate)"}>}

      HANDLE_RELEASED_BONUS)

      )

      +

      If( vFundTypePlayable = '0',

      Sum(

        {$<[SUMMARY_DATE] = {">=$(vStartDate)<=$(vEndDate)"}>}

      HANDLE_PLAYABLE_BONUS)

      )