7 Replies Latest reply: May 5, 2017 12:08 AM by Rahul Pawar RSS

    Help in writing an expression

    Vijayanth Radha

      What is wrong in the following expression?


      In a table, I'm trying to show my dimension "Year" only for the years where it is greater than a variable where is the user is setting. Variable name is vLimit.


      {<[Year] = {">$(vLimit)"}>}


      I'm getting an invalid dimension error. What is wrong with this syntax? Please help

        • Re: Help in writing an expression
          Craig Sutton

          Are you trying to do a calculated dimension or modify your expression with set analysis? If you are modifying your expression then what does your full expression look like?

            • Re: Help in writing an expression
              Vijayanth Radha

              Lets say I have data since 2005. By default, in a table, we display data for the last 5 years. We pass a variable in the measure to show only the sum for past five years. Users can click a button to change the variable which will then display data for all years (since 2005). Everything is good so far.


              But when the table opens by default, users are allowed to select a year which is, lets say 2006, (which is outside of last 5 years). For this selection, the table is not showing data since the measure is trying to calculate sum for for last 5 years and the user selection for year is 2006.


              So I want to somehow only show past 5 years in "year" selection in table and show all years to select ONLY when the users click in "All Years" button.

            • Re: Help in writing an expression
              Sunny Talwar

              May be like this


              Sum({<[Year] = {">$(=vLimit)"}>}Measure)