Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How is it possible to create custom function with parameter that you can use in the Expression of chart object avoiding to duplicate n times the same code in all object ?
For example i would like to create this kind of function with 1 parameter $Param1 and reuse it in the expression of several objects :
MyFunction($Param1)
=if(max(Month)<2,'-',
sum({<Month = {"<=$Param1"}*{">$(=$Param1-VRolling_Month)"}*{">=1"}>} [6 - BREAKDOWN LOSS -- Total machine lost time (Hours)])
/
sum({<Month = {"<=$Param1"}*{">$(=$Param1-VRolling_Month)"}*{">=1"}>} [6 - BREAKDOWN LOSS -- Total opening time (Hours)])*100)
End Function
You cannot define funtions but you can store formulas in variables and pass parameters. Here is a simple example:
Store formula:
var1 = "sum(if(customer=$1 and year=$2,1,0))"
Use in diagram:
=$var1(param1, param2)
Ralf