1 of 1 people found this helpful
You can use an expression AF analysis to do aggregate MTD and YTD calculations. For instance, for a tag average MTD and YTD calculation for the attribute 'sinusoid', your analysis expressions might look like the following:
The Bom() expression returns the beginning of the month, and using the datetime '1-1' returns January 1st of the current year at midnight. It is also possible to do this using performance equations or totalizer tags, but AF analyses would be recommended over these approaches.
Thanks for your response. How can I apply this to 3 or more PI Points ?
Will this work for 3 tags below:
You will need three different expressions: TagAvg('Sinusoid', '1-1', '*') + TagAvg('SinusoidU', '1-1', '*'') + ....
If you are using analytics, you can use a rollup and this will allow you to dynamically add additional sums without modifying the logic. Note, YTD and MTD expressions can involve a lot of data and I would think about how often they really need to trigger.
2 of 3 people found this helpful
No, this will not work. We do have online Help for the PE functions. It may benefit you if you can become familiar with it.
Here is the help for the TagAvg function. The first line states: Find the time-weighted average value of a point over a given time, according to values stored in the PI Archive. Both the phrase "of a point" as well as the examples shown at the bottom of the page indicate that this function is for ONE tag at time.
There is also the Avg function, which returns the average of multiple arguments.
It is apparent to me that you would require a combination of both of these functions, where you first compute the TagAvg individually for each input tag, and then finally Avg that. Here is an example for Month. I leave it to you as an exercise to do the same for the Year.
Avg( TagAvg('SINUSOID',Bom('*'),'*'), TagAvg('SINUSOID2',Bom('*'),'*'), TagAvg('SINUSOID3',Bom('*'),'*') )