# Learning Lab - Daily Production Report Part 1

Discussion created by Pablo Benvenuto on Sep 13, 2012
Are you responsible for submitting production reports?  Well, I have a treat for you!  This Leaning Lab will teach you how to extract calculated values using the Calculated Data function in PI DataLink.  We will use a template that you can download from here, or if you are using the OSIsoft Virtual Learning Environment you can find the template in C:\Labs\Visuals\Daily Production Report\Workspace.

Let's assume you are a production manager and want to create a report showing last week’s daily production totals.  You want to display the total production, average, minimum and maximum and standard deviation for that week.  Also, you would like to present this data on a daily basis.  Well, you just got lucky, because I am going to show you how to do all of that in a few simple steps.
We’ll use the built-in Calculated Data functions to show the above stats for the entire week (no time interval needs to be specified) and each day of the week (time interval of 24h).

Performing weekly calculations in our report with PI DataLink

Let's get going,

1. Open the template.
2. First, fill out the Weekly Total section of the report.
3. Select the cell B16 and use PI > Calculated Data to get the total.

4. In the dialog box select the Tagname field and select cell B3.
5. Next, select the Start Time field and click on cell B4.
6. Select the End Time field and select cell B5.
7. For totals you must select the appropriate conversion factor.  As shown in the template, units are GPM (gallons per minute).  As PI will assume the rate is in units/day, a conversion factor of 1440 minutes/day needs to be applied.  Type 1440 in the Conversion Factor field.
8. Ensure the Calculation Mode is set to total.
9. You can now click OK.  The interval argument here is not needed, as we need a single result for the time range.

10. Finding the average is very similar, click on cell C16.
11. Click on the Calculated Data function.  Select the same inputs as before for the Tagname, Start Time and End Time.  Select average for the Calculation Mode.
12. Click OK.
13. You can now find the rest of the weekly calculations: minimum, maximum and the range for that week by repeating the same steps as before and modifying the calculation mode.
14. For the last calculation in the section (range) check the show percent good option to verify that the data has existed for the whole calculation period.

Do you want to try doing the daily calculation on your own?  Give it a shot and then go to Part 2 of this Learning Lab to compare results.