cancel
Showing results for 
Search instead for 
Did you mean: 

Using the Tag Query's Statistics Mode

Former Member
0 Kudos

I've tried to come up with the average of tag values over a span of a month two different ways:

1. using the Statistics mode

2. using the HistoryEvent mode and averaging the resultant data with an average function.

For most tags the two results are quite similar. I have one tag however that contains a lot of zero values and for that tag, the Statistics mode average is about 10% higher than the HistoryEvent mode average. It's like the Statistics mode ignores the zero values when doing it's calculations.

Is this correct? My tag query is returning data from six tags - does this cause the Statistics mode any heartache?

David Macindoe

Accepted Solutions (1)

Accepted Solutions (1)

jcgood25
Active Contributor
0 Kudos

Statistics Mode can be specific to the actual Data Source itself - what is your underlying Historian?

6 tags shouldn't matter since each one is independent when it comes to MIN,MAX,AVG, etc.

Regards,

Jeremy

Former Member
0 Kudos

I'm connecting to a PI server. The server is running PIUDS_2_5_0_0 and UDSFramework_2_5_0_4 I don't have any more info on the PI version itself but I can find out. I know it's running on a Windows 2000 Server.

David

jcgood25
Active Contributor
0 Kudos

David,

Martin K - if you are listening please feel free to correct or confirm the following:

The PI UDS uses native Statistical method calls to the PI API/SDK, so the results are coming directly from PI. In this case, xMII is not doing a HistoryEvent call and then doing the average calcs on the raw event records, like it would be if you did it in BLS.

Regards,

Jeremy

Former Member
0 Kudos

Thanks, Jeremy. I was assuming the Statistics mode was pulling all tag values for the requested date range to the xMII server and doing the statistics processing there. In any event, I really can't use it because it's giving me incorrect results. I'll just go with the HistoryEvent call and do the averaging in BLS.

jcgood25
Active Contributor
0 Kudos

xMII will typically do stats processing from HistoryEvent data, only when native stats processing in not available in the underlying system.

Jeremy

Answers (0)