YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Averaging A PI Calculation Options · View
jrubb130
#1 Posted : Tuesday, August 03, 2010 2:30:29 PM
Rank: Newbie
Groups: Member

Joined: 8/3/2010
Posts: 2
Location: Maine
Hi i'm relativity new to PI and I'm trying a average a PI calculation between -2months and -1 one month. If I type 60d in the interval text box it averages it to today. I would only like the average between 2 months ago and 1 month ago.

Can anybody help?

Thanks
Sponsor  
 

OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System.
We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ  or contact OSIsoft vCampus for more details.
RJK Solutions
#2 Posted : Tuesday, August 03, 2010 3:30:55 PM
Rank: Administration

Groups: Administration

Joined: 6/20/2008
Posts: 612
Location: Cheshire, United Kingdom.
Hello,

Welcome to the forum.

What does your expression look like? You could do something like the following:

TagAvg('your_pi_tag.pv','*-2month','*-1month')

OR

TagAvg('your_pi_tag.pv',BOM(BOM('*')-1),BOM('*'))

It depends on what you want the monthly average to be relative to, now/current/snapshot or the beginning of the month (e.g. BOM PE function)

Cheers.
Principal Consultant
Real-Time Data Management @ Wipro Technologies
jrubb130
#3 Posted : Tuesday, August 03, 2010 4:01:37 PM
Rank: Newbie
Groups: Member

Joined: 8/3/2010
Posts: 2
Location: Maine
Thanks for getting back to me,

I'm just trying to show the average values of a tag for 30 days ago, 60-30 days ago so on a so forth. Basically monthly averages from present day. What should I use for an interval?

thanks
RJK Solutions
#4 Posted : Tuesday, August 03, 2010 8:54:01 PM
Rank: Administration

Groups: Administration

Joined: 6/20/2008
Posts: 612
Location: Cheshire, United Kingdom.
The interval to use depends on your definition of a month. If you just want the 30 day average then you can use the day interval, e.g.

TagAvg('sinusoid','*-60d','*-30d')

Some people would consider a monthly average to be from the 1st to the last day of the month, in which case you would have a different syntax.
Principal Consultant
Real-Time Data Management @ Wipro Technologies
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.