4 Replies Latest reply: May 4, 2017 9:22 PM by Khim Hoe Tan RSS

    Variable in Expression stored as Variable

    Khim Hoe Tan

      !Hi all,

       

      Currently I have this expression:

       

      sum({$<Age={'$(vAgeRange)'}>} Amount)

       

      I have 2 buttons in my layout with an action that will change the value of the vAgeRange variable.

       

      Now, I need to store this expression in a variable in the script so that I can call the variable in my chart instead of using the expression in chart.

       

      SET vExp_Amount = sum({$<Age={'$(vAgeRange)'}>} Amount);

       

      The problem is that the vAgeRange will be evaluated in the script level. Due to this, the expression become static in the chart (since the vAgeRange is not evaluated anymore in the chart)

       

      Any idea on how I can get around this?

       

      *Attached is the example with the 2 workarounds suggested below. Thanks for the help!