Access to the surrounding values
Trends comes with a handy function getAround. For each point, it returns an array with the surrounding values. This is useful to measure derivatives or max/min/averages... with standard Javascript
getAround(name, countBefore, countAfter)
name: the name of the parameter as string
countBefore: the count of samples to get before the current point
countAfter: the count of samples to get after the current point
Be careful as the name of the parameter is a string. If you do not mention the parameter as a variable in the formula, then WILCO will not fetch it from the database.
The following would not work
In those simple cases, you will have to mention explicitely the variable, for example like this:
Last updated
Was this helpful?