In this video I will show you how to set up
a roll up calculation. A roll up is a way to easily
calculate summary statistics for
your assets. Let me show you what a roll up
looks like. I'm here in PI System
Explorer and I'm looking at the AF database for discrete
manufacturing. Now, roll ups
were used to determine these two
KPIs. The average number of bad
units produced by each line at a plant facility
for the week. I notice that the plant
facility that we're taking a look at is Cleveland, and
Cleveland happens to have five different
lines. And the other KPI, the total number
of good units produced by all the total
lines at the facility for the week.
Well where did the information for this calculation
come from? It actually came from the child
attributes. If we look at the different lines
we can see that they all have these
count bad and count good attributes
right here. And these attributes are
used for the average and total taken at
this level. And this has been done for
each facility, so Cleveland, Detroit,
Houston, etc.
These KPIs can be easily
compared. Now, for an element
a roll up is set up under
the analyses tab.
If you don't see this analyses
tab in PI System Explorer
you probably aren't using the latest version
of the PI server, which includes AF server
2014, or the client tool.
I could set up these two roll ups for each of
the facilities, but to save even more
steps I'm going to do the roll up at a
template level. And I can do this because each
of these facilities and the
other ones, are based off
of a plant facility template, which you can
find under Library in
templates, element templates, and then the facility template
is right here. The roll ups
were set up under the analysis
templates for that facility
template. I'm going to step back and show you all the steps to set up
these two roll ups. If you're
setting up a roll up on an
element, you would use the analyses tab that we looked at
before, and perform the same steps. Let's start from the
beginning. So I'll start off by
choosing the create a new
analysis; and now the analysis
templates panel looks similar to how we
saw before. We start off on the right hand
side. I'm going to give this roll up a
name of
average bad units, and I'll
include a full description
and for organizational
purposes I'll also choose
the KPI category. You can create
your own categories as a way
to organize your analyses and improve
the ability to search for them.
The next important section is choosing
roll up, this middle
option here. One thing to keep in mind when working off
a template is you only need to select an example
element. This is because the template
itself does not have attributes that are
linked to specific values to evaluate the
calculation from. So Detroit
is one of the example elements, but if I click
on Detroit I have basically the option of
choosing any example element
that is based on the facility
template. Then I'll need to choose where to get the
roll up attributes from. As we saw
earlier there are child elements of
each line, which contains the attributes that we're
interested in; so I'll stick with the child's
element options. Next I will need
to find the attributes that I want to
roll up by using this search
criteria. I'll choose the attribute
name since I know there's a count bad
attribute; and as I type that in
this entire attribute list showing up on
the right, which is based off of the attributes of all the child
elements of Detroit, now have
check marks next to the attributes that match the
criteria; these count bad.
Then I'll choose the
function, and in my case the function that I'm interested
in is this average here.
I can use the evaluate
button to look at what the result
of that calculation would be at this particular
moment. I'll additionally need
to choose where I would like this calculation
to be output to, and I'll select
map. Once I select
map it will bring up a list that will include all the attributes that
are available in this template. And I've already
set up an average bad units attribute
before. Later on we're going to see
how to create a new attribute
template and explore the option of writing to PI tags
in addition. For now I'm going to select my average
bad units attribute. And the last choice I'll need
to make is on the scheduling down here.
For the average bad
units I want to have this
calculation run any time one of
these count bad attributes
gets a new value. So I'm going to choose
the event triggered option, and it will
trigger on an input. Now that I've done all
the configuration for the roll up I'm going to check in
my changes.
Navigating back to my elements I see that
I have the average bad units. Right now
my value is zero,
which is simply what
the default value was for
my template. But I happen to know that
the values for the attributes the roll up was based off
of update pretty frequently, so I'm going to go ahead and
hit refresh. And it looks like I have
received a new value, so my average bad
units now has a value for the roll up
calculation. So this is what the average bad units
roll up looks like for my different
facilities. Let's go back and
set up under the analysis template the other
roll up that we saw. To create a second
analysis an easy way to do that is to right click on this
white space and select new.
I'll again go to the right and start with the name; this
will be the total good
units. And again I'm choosing
the roll up option. I'm still interested
in the attributes of the child elements and I'll use the
attribute name to look for
count good. And in this
case I'll choose to do a sum, and I'm going to
map this. Before we talked
about that you don't have to map
it in existing attribute, so I'm
going to use the new attribute
option, and then I'll be able to choose
its properties.
To keep things nice and organized I'll choose the
KPI category, and it's always good to set a unit
of measure to keep track of
things. And this will be
a count, and I could choose a value type
of double but I'll actually switch to
single. And for the data reference I'm going to
use a PI point and hit the
settings. One of the exciting new
options is the ability to write the analysis
outputs to PI tags, and to have those tags
created through AF using this tag
creation selection option. It's actually
highly recommended to store the analysis
to PI tags so that you can historize the
date and it also improves the AF performance.
The tag attributes can be configured by selecting this
drop down. I'm gong to use the
defaults and hit okay.
Lastly I'll schedule
it, and in this case the total good
units I'm interested in evaluating this at
the end of a shift, so I'll use the periodic
scheduling. In this case
I could go ahead and say if I have shifts every
eight hours that I wanted to run this calculation
for, I could go ahead and set it up
this way. And this provides
at the bottom the example evaluation
times. If your shifts are every 8 hours but didn't
start at midnight, then you could use the
specify offset. Now, for the purposes of this
video I'm actually going to reduce my shift time
considerably so we could see this actually being
evaluated right away. I'll go and
check in my changes,
and now if I navigate to
elements you'll notice that I have
both of my roll-ups, and there's this interesting
message on PI point not found.
Now, I thought we had checked that box for
tag creation; well that enables the tag creation
but in order to create the tags what I'll
need to do is actually, if I want
do this for all of them at the same time I'll
right click on elements and I'll choose the create or update
data reference. This will create or update
those tags. I'll check in
my changes
and now I have the
average bad units and total good units
for each.