If you ever want to see what a data item has been doing in your PI System over time you'll
be using the multiple values query right here and in this video we're going to be looking at
Sampled Data. To contrast that we're going to contrast it to Compressed Data. So what it is
we're going to be using sinusoidal at first just because it's a great example of this.
I'm asking for the data for sinusoidal from Monday to Tuesday using compressed data and Monday to
Tuesday using sampled data. What sampled data allows me to do is I can define an interval--a
very clean interval so one hour. So I can see that I've got values for sinusoidal every hour right
there and it's very nice, it's really clean. Now contrast this to compressed data; the PI System
is going into the archive and pulling up the raw values. Now these raw values aren't necessarily
going to be on even, pretty time intervals. And maybe that's what you want in which case
you want to use compressed data but if you want clean intervals you'll be using sampled data.
This is particularly useful if you want to compare many PI tags against each other. So if you wanted
to compare ten PI tags against each other on the hour every hour you'd probably be using sampled
data. This is what it looks like. So sampled data--even intervals--compressed data--maybe
uneven intervals but it's all the raw data so it reproduces this trend. What sampled data is
doing is it's merely interpolating between these points. So this point right here, well that's
an interpolation of compressed data right there; that's all it is. Now there is one danger that can
go on here is if you--yeah here it is-- if you use an interval that's really small like four hours
well maybe you're going to be missing out on some of the peaks. You can see here we're not really
seeing this as a sinusoidal anymore. Maybe this is all you want; you want to know what was going
on with the process every four hours. Now lets put together a sampled data query. First you'll click
on "sampled data" and then we'll see what we need. So first off we need a data item. That's the PI
System tag or the PI System asset that we want to see data for. Then a start time and an end time.
So that's the start and finish of how long we want to see data for. And the time interval...how
frequently do we want to see data? Then the output; so where on this sheet do we want it
to go? So to start off with data item we need to add that to our sheet. I'll just close this and
say "data item" and now I'm going to search for it and I'll find what I want. So "fuel oil flow" and
I click this--double click on it--and it's brought into my sheet, "fuel oil flow" and then I need the
start time and the end time and an interval. The start time let's say we want to know everything
from yesterday morning until this morning. So we use "y"--that's PI shorthand for yesterday--and
we use "t"--that's shorthand for today--and interval, 1H. So that's what the interval is
we want to use. Then we'll write "sampled data" and click on "sampled data" and now we just link
these up. So you click in the data items field and you click on B2--that's where my data item
is--click on the start time field and now I'm going to click on B4 because that's where my
start time is. The end time field is B5, time interval field is B6 and the output cell.
So now I'm going to click where I want it to go--that's right there; it's already taken care of
and I can click "apply" and then if I want to see timestamps I can just put this checkmark box here,
click "apply" again and I'll see timestamps. Now we can see it's coming in every hour right like
that...boom, boom, boom...and we see the values right there for each hour. If I want to see a
different frequency all I need to do is just change the cell here. I don't even need to have
the wizard open. I can just say, "three hours" and now it changes to every three hours. I can change
it to every thirty minutes. Now you'll see every thirty minutes. I can also change the interval or
the time I'm asking for. Maybe I want to see what was going on a week ago so yesterday minus seven
days and today minus seven days every hour and now we can see we've gone back a week to March 7th.
All right now that's the basics of sampled data.