in the previous lessons we used different pi datalink functions to access the raw
data stored in the pi server however you may not be interested in bringing all the raw data but
instead apply calculations on these row values as they are retrieved from the pi server one of the
ways to bring in the calculated values into pi datalink is to use the calculated data function
it returns a single calculated value or evenly spaced calculated values for a pi point or af
attribute as you can see there are different calculation modes available such as total minimum
maximum and so on as you see most of the fields are similar to the other pi datalink functions
we have already worked with some of the fields specific to this function are the time interval so
it is an optional field and if used it allows the behavior to be similar to the sample data function
and the calculations will be done for evenly spaced time intervals checking the show percent
good option displays the percentage of good data for the calculation time range you can
use this to determine if you want to use the data that may not be 100 percent good time to practice
so we want to practice how to use the calculated data and obtain the average maximum and minimum
of flow rate for mixing tank 1 for the period of past two hours and for the past one day let's
begin by creating a template in excel for our report so we want to have a cell for the root path
data item start time and end time
now let's go to search and let's find the flow rate attribute for mixing tank 1
and bring it to our report we want to separate the root path and the data item
so let's move the slider to name only
first we want to see the values for the period of past two hours so our start time will be asterisk
which translates to now and end time will be asterisk minus two hours so two hours ago
now let's create columns for the average maximum and minimum values
now click on cell c2 select the calculated data function
select our data item root path start and end time and the calculation mode average
now let's repeat the steps to obtain the maximum and minimum values
so click on cell d2 select the calculated data function now select our data item
root path start and end time and the calculation mode maximum
now click on cell e2 select the calculated data function
select our data item root path start and end time and the calculation mode minimum
now let's change the end time to asterisk minus one day
to see the values for the past one day and watch how the pi server recalculates
these values this concludes our video on the calculated data function thanks for watching