Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear community,
i want to let the user choose between average and median in buttons.
So, is it possible to take the Avg and Median function in a variable, let say v_fun?
And how to evaluate functions within the variable on my dimension, let say body_weight? (How does the syntax look like?)
Thanks
Hi @DSDD
Create a variable and assign the value like below
variable name: v_fun
value: Avg($1)
In chart, ur dimension and expression is like
$(v_fun(body_weight))
-- gives average of body_weight based on ur dimension
Hi @DSDD
Create a variable and assign the value like below
variable name: v_fun
value: Avg($1)
In chart, ur dimension and expression is like
$(v_fun(body_weight))
-- gives average of body_weight based on ur dimension
Thanks for your answer. It works.
What does $1 achieve in this context, especially when $(v_fun(body_weight)) is evaluated?
Hi @DSDD
$1 here is works like parameter, you can pass any field name.