12 Replies Latest reply: Mar 5, 2015 9:13 AM by Chris Lofthouse RSS

    How to use variable in set analysis ?

    Laura Sébille

      Hello everyone,

       

      In my application, there are data for several years and I would like to show in a graph only the last 3 years (current one + 2 laters).

       

      So I created a variable : vCurrentYear = max(MyYear)    // MyYear is a field in my calendar that goes until the date of execution.

       

       

      If I put =$(vCurrentYear)  in a textbox, I do get 2015.

       

      In my graph, in the expression tab, I have entered  in order to get the sum of Cpt_abt for the past 3 years.

       

      sum({$<Year_S={">=$(vCurrentYear)-2"}>}Cpt_abt)

       

       

      But I get the message "No data to display".

       

      If instead, I put

      sum({$<Year_S={">=2013"}>}Cpt_abt)   , I do get my graph.

       

      I am guessing there must be something wrong with the quotations marks but I cannot find the proper way to write my expression..

       

      Any ideas ?

       

      Thank you for your help