Quest about value range average ?
-
I have a question code like
<ma-now update-interval="15 SECONDS" output="theTimeNow"></ma-now> <ma-point-values point="point2" values="point2Values" from="theTimeNow | maMoment:'subtract':1:'Month'" to="theTimeNow" rollup="AVERAGE" rollup-interval="1 HOURS"> </ma-point-values> {{}}
how do I code to show a point2 last value from ma-now to before a month average kind of ma-point-values filter in {{}}?
not{{point2Values}}
this way. because like pic. I need just a number.
-
Hi Sean
I am not sure what your question is. if you want the last value from the array you can do this:
{{point2Values[point2Values.length-1].value}}
or if you want the first value
{{point2Values[0].value}}
If you looking for the average value over the whole month you should use
<ma-point-statistics point="point2" from="theTimeNow | maMoment:'subtract':1:'Month'" to="theTimeNow" statistics="statsObj"></ma-point-statistics>
{{statsObj.average.value}}
Is that what you are looking for?
-
@craigweb Yes it work!