Hi. On a C" script, I need to get all values from parameters for last week to calculate an average.
How could I found the good function?
Kind dojo.
Assuming your parameter is trended, you can use the GetTrendDataMessage in combination with the Engine SendSLNetMessage method to get what you need.
Hi Toon, Henry,
This sounds like a typical GQI query. Therefore:
Henri > what is your use case? Because if you just want to be able to display this, then this could probably be done with a GQI in a dashboard.
Toon > if the use case is about using that average in the context of an automation routine for example, can a GQI today already be called upon from within automation? If not, is that on the roadmap?
Toon > if the use case is about being able to 24/7 calculate that average in the background and be able to alarm and trend on that aggregated metric again, then this would translate into defining a GQI that runs in the background (not just upon opening up a dashboard). I believe we have that on the roadmap, but not sure if it is just in the backlog (and hence we do not have yet visibility on when that will potentially be available), or if this happens to be in the making?
Thanks!
For giving you more data:
- The parameters will be trended
- the weekly average that we will calculated, will be use to be trended and to create a new alarm.
We have 4 protocols concerned by this calculation and the number of elements will grow from 120 to quite 2000 in some month.
We do not have for the moment an Elastic Search DB. Is it necessary ?
The weekly calculation only need to be done one time each day.
Hi, for this type of use cases, I would check first if aggregation rules can be used. In case aggregation rules does not fit for the use case, then indeed I would try to move in the direction of GQI.
+ For the use case: ‘using that average in the context of an automation routine for example, can a GQI today already be called upon from within automation’: A possible option is using the DataAgrgegator DxM. You can configure the DataAggregator to run a GQI query to be executed at any frequency and store the calculated value (in this case the average) in a CSV file for further processing.
+ For the use case: ‘being able to 24/7 calculate that average in the background and be able to alarm and trend on that aggregated metric again’: we could create a connector that process the CSV files generated by the DataAggregator. In this connector we can enable alarming/trending on the aggregated data. However, we need to be careful with the amount of data to be processed. For example, if you plan to calculate the average for thousand of rows in different elements, then it is advised to use a logger table for data retention.