Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I created some line charts with similar looking but different expressions and different formula. I used several variables to make my charts dynamic. I would like to see whether I can have different definitions for one variable in order to reduce the number of variables and to make the maintenance easier.
Thanks
Longmatch
You can use variables within variables. For example:
vSales2012: sum({<Year={2012}>}Sales)
vSales2013: sum({<Year={2013}>}Sales)
vVariance: num($(vSales2013)/$(vSales2012) -1,'#.0%')
This way you could redefine vSales2012 or vSales2012 and every variable that uses these variables (like vVariance) will use the new definitions.
You can also pass parameters to variables:
vSales: sum({<Year={$1}>}Sales)
vVariance: $(vSales(2013))/$(vSales(2012)) -1
I am sorry I might not state my questions clearly. Here is my example. I have a variable named vVariance and its formula are different based upon the data type (continuous data vs discrete data). I do not want to use different variable names for different type of variances. How to implement it? Thanks