2 Replies Latest reply: Sep 26, 2016 12:04 PM by Sunny Talwar RSS

    IF & GetFieldSelections

    Michael King

      Hi all,

       

      I am trying to create a formula which selects the expression based on whether a field has been selected or not.

       

      The aim is to show previous YTD (e.g. sum({<_YTD_PY={1}>} [Total Discount])), however when a user selects another year, the formula would instead show sum([Total Discount]).


      Currently I have:

       

      IF(

        GetSelectedCount(Year)=0,

          sum({<_YTD_TY={1}>} [Total Discount]),

              sum([Total Discount])

      )

       

      This formula works if no year is selected, however if a year is selected it will only show 0.

       

      Any help would be much appreciated.

       

      Thank you in advance.