AnsweredAssumed Answered

Creating PIavg View in PI SQL Commander lite

Question asked by Nawdeep on Jan 5, 2019
Latest reply on Jan 6, 2019 by LalBabuShaik

Hi All,

 

We want to create a view in PI SQL Commander lite comprises of hourly average of the tags(let's say 10 tags) for the particular time frame (let's say last 2 days).

 

Using below query :

SELECT a1.tag as "tag1",a1.time,a1.value,a2.tag as"tag2",a2.value

FROM [piarchive]..[piavg] a1

inner join [piarchive]..[piavg] a2

on a1.time = a2.time

WHERE a1.tag = 'sinusoid'

AND a1.time BETWEEN 'y-1d' AND 't' and a1.calcbasis = 'EventWeighted'

and a1.timestep = '1h'and a2.tag = 'cdt158' and a2.timestep = '1h'

and a2.calcbasis = 'EventWeighted'

 

Result:

 

Our Requirement is to get the values in the below format :

 

 

Please help us out with the solution.

Thanks in advance

 

 

Outcomes