hodneeri

piavg vs pitotal - both return same value???

Discussion created by hodneeri on Jan 27, 2014
Latest reply on Sep 23, 2019 by Dudley McFadden

Hi! Guys,

 

I need some help on piarchive..piavg & piarchive..pitotal. :)

 

 

 

When query data from piarchive..picomp2 with below sql

 

SELECT tag,CAST(value AS Float64), time FROM piarchive..picomp2 WHERE tag = 'SINUSOIDU' AND time >= DATE('2013-12-20T00:00:00') AND time < DATE('2014-01-01T00:00:00');

 

8546.Untitled1.png

 

 

 

When query data from piarchive..piavg with below sql

 

SELECT tag,CAST(value AS Float64), time FROM piarchive..piavg WHERE tag = 'SINUSOIDU' AND time >= DATE('2013-12-20T00:00:00') AND time < DATE('2014-01-02T00:00:00') AND timestep = '1d';

 

6607.Untitled2.png

 

 

 

 

 

When query data from piarchive..pitotal with below sql

 

SELECT tag,CAST(value AS Float64), time FROM piarchive..pitotal WHERE tag = 'SINUSOIDU' AND time >= DATE('2013-12-20T00:00:00') AND time < DATE('2014-01-02T00:00:00') AND timestep = '1d';

 

6761.Untitled3.png

 

Why the query data returned from piarchive..pitotal is same/similar as piarchive..piavg?

 

 

 

When query data from piarchive..pitotal with below sql (calcbasis = 'EventWeighted')

 

SELECT tag,CAST(value AS Float64), time FROM piarchive..pitotal WHERE tag = 'SINUSOIDU' AND time >= DATE('2013-12-20T00:00:00') AND time < DATE('2014-01-02T00:00:00') AND timestep = '1d' AND calcbasis = 'EventWeighted';

 

0880.Untitled4.png

 

When query data from piarchive..pitotal with calcbasis = 'EventWeighted' criteria, its return the correct sum values?

 

Is there have any document reference on how to query data from piarchive related table (piavg, picomp2, pimax, pitotal & etc) in a proper/correct way or any related documentation describe those piarchive related tables in detail?

 

Please correct me if i'm wrong. 

 

Thank you.

Outcomes