Statistics Extensions

Would it be possible to do either of the following:
a) Find the average of a data point across a period for Mondays only? i.e.
<mapointstatistics point="myPoint1" from="dateBar.from" to="dateBar.to" statistics="statsObj1"></mapointstatistics> <p> The average value for Mondays in the period is {{ statsObj.averageif."Timestamp=Monday".value }} }} </p>
I've tried a few techniques using moment filters but have had no luck.
b) Somewhat similarly, could you find the average of a data series if another series is equal to/greater than/less than another value for the corresponding timestamp? For instance:
<mapointstatistics point="myPoint1" from="dateBar.from" to="dateBar.to" statistics="statsObj1"></mapointstatistics> <mapointstatistics point="myPoint2" from="dateBar.from" to="dateBar.to" statistics="statsObj2"></mapointstatistics> <p> The average value when myPoint1 is greater than myPoint2 is {{ statsObj.averageif."StatsObj1.value>StatsObj2.value".value }} }} </p>
I think these Excel style operations would be really useful to visualise trends in data immediately.
Cheers, Henry

@henryblu It sounds like you are going to need to write some specialized logic in JavaScript. I'd suggest adding a custom component via the user module, see https://help.infiniteautomation.com/gettingstartedwithausermodule/
You can leverage our
maStatistics
andmaPointValues
services to pull data from the REST API then process and output the data onto the page from the component. You can use the moment.js library directly inside your component, also we recently added the math.js library which might be useful. It has statistics and matrix functions.