Here we're going to focus on roll-up analyses. In previous videos we've
taken a look at expression analyses, these are our basic analyses or we write out functions
in our equations. Roll up analyses are just that, we will roll up several calculations
to be able to handle a broader picture of what's going on in our processes.
I will walk through an existing analysis example kit which I will also link in the
description. In the power generation load forecasting database, we're going to see
that there's a number of rollup analyses. In this particular scenario we have a Sungas power
generation company. In that company there are two different plants south and west. In
south we have Karnak and Piney Woods and in the west we have the Bryce Canyon production lines.
If we take a look at each of these individually we can see there's quite a lot of attributes on
each one; and one of these attributes is the total power generation actual,
down here at the bottom. Now Karnak has that, Piney Woods has that and Bryce Canyon also has
it. What we'd like to see is if we can do a rollup analysis so that we can know at
each stage what the total power generation is for each of the plants both south and west,
as well as all together for the entire Sungas company. If I take a look at the
next level up we can see that I have the total sum generation, now for West since there's only
one child attribute it should match what's there on Bryce Canyon. We can just verify
that that number is the same and it was eight forty four point one two nine and that matches.
Let's take a look at the South plant. In the South Region we have 1722 megawatts.
Let's take a look at Karnak and Piney Woods and make sure that that adds up;
and that added together gives us our total. If we look at Sungas itself we can see that we
have a total value of 2566 megawatts, and that's including both the south and the west regions.
Let's take a look at the analyses themselves and see how our roll-up calculations are configured.
Later in the video I'll walk through an example so that way we'll configure one together.
This icon indicates that this is part of a rollup calculation, we can see the analysis
type here is a rollup, this shows up as gray because it's part of a template and we're
not making any changes to the individual pieces from the template. Typically but
not exclusively rollup attributes will utilize the child elements, you are also able to make
a rollup calculation on the current element that you have. To get started with building
out our analysis we want to take a look at the sample child element. Here we've chosen South.
Once we've chosen the sample child element we can see the attributes that are associated with it.
Once we see the attributes associated with it it's time to select our filters in order
to make sure that we can sum up or make a rollup calculation based off of the child
attributes. In this case we'll put in total generation and we append an asterisk so that
way it adds on any and all characters. Using this filter we can find a total generation
underscore sum attribute and that gets a check mark on the right. You can see that
we can also filter based on the attribute category as well as the attribute level.
If we take a look at the other parent elements we can see that these are arranged in a similar way.
In this particular case we've only changed our filter to total power and that way we can get
the total power generation. You can notice here that the sample child element is Karnak as that
one is under the South Region, in each of these we have them scheduled as event triggered. Now this
may cause performance problems and depending on how many child attributes are going to be
involved in this calculation we would advise that you use a periodic scheduling to limit the amount
of calculations this will have to do. I'll go over that again when we do our own example.
Imagine that you had 10 plants in the South Region to get the total generation all you
have to do is put in this one filter that matches on the same child attribute. Having
similar child attributes is going to be easy because you'll likely be leveraging
the use of templates. In that way you're able to see you can easily filter on a
child attribute value and quickly make many different calculations using the roll-up
analysis. Let's take a look and make our own example for how we can use a roll-up analysis.
To configure an example of the roll-up analysis let's go back onto another database. The oil and
gas well down time tracking full database. And again I have two well pads Clear Fork and Odessa
as well as a production area West Texas. I'm going to make two roll-up analyses, one on each template
in order to make sure that we can calculate the average gas gravity at each of the sites,
as well as for the entire production area. We'll start by configuring it for Clear Fork that way
our role of analysis is present when we go to the West Texas level which is the production area.
I'm going to do this on the template since these are already based off of the template
and we want this to propagate to all of the elements that are based off of that template,
it makes the most sense to configure it here. Again we'll start with a well pad;
we can see there's a number of rollup analyses on here already we'll right-click, new, rollup
analysis and all I have to do since child elements of Clear Fork is already selected I'll just filter
on gas and filter with a star and I can see at the top gas gravity is now selected. I'll choose an
average and I'll map an output to a new attribute template and I'll hit OK. When I check this in,
this attribute will start collecting data for both the Odessa and the Clear Fork sites.
Next, I'll go to my production area template, I'll configure a very similar roll-up analysis.
So now that we can see that we have the gas gravity average attribute,
again that is because we created it on the well pad template first, we can go over and we can
make sure that we can select it. I can use the same filter to just get gas and I'll make sure
to choose the average and I'll map it. I can also change the name. I'm going to change my
triggering criteria to be periodic and that's because this is for my entire production area,
since all of my well pads and all of their child attributes are event triggered,
that means anytime any of these gas gravity events comes in it would then trigger my production area
if it were left as event triggered. By changing it to periodic it means that my calculation will run
less frequently, but I'll still get updates every 5 minutes if I leave it as the default setting.
I'll check this in and we can check and see if our production attributes are updating.
So it looks like we have 0.83 for the average gas gravity from these different wells. And
it looks like it's just one particular attribute on well 31 that's above that
pulling up the average and in a few minutes we'll expect for our point creator to change
to the actual value for gas gravity after it's calculated on that 5-minute interval.