# Creating a Calculation (General Steps)

So, you have created a new Calculated Channel and you are now ready to configure it with a FACE formula or function. This topic provides general directions for configuring your Calculated Channel with a FACE calculation.

Important: This topic is a continuation of topic, "Creating a Calculated Channel". The primary assumption in this topic is you just finished creating a new Calculated Channel, and you are now ready to set up the respective calculation. With this in mind, you will find the instructions in this topic starts off from the Configure Sites page, where you are navigated to immediately after setup of a new Calculated Channel is complete.

#### The process for fully establishing a Calculated Channel is twofold:

1. Start by creating a Calculated Channel. Once you have created a new Calculated Channel, you will need to proceed to step 2 (which is discussed in this topic).
2. Configure a FACE calculation that is to be applied to data in the Calculated Channel, only after you have completed step 1. This step is discussed in this topic.

Before continuing on in this topic, please ensure you've reviewed the following:

The User Guide also discusses some practical scenarios for using formula and function calculations. Please see the following topics for details, including step-by-step instructions for replicating the use-case:

## Configuring a Calculated Channel Using a Formula (General Steps)

The Formula option in FACE is a popular choice because it enables you to manually define an equation using basic math, trigonometric formulas, the Circle equation and IF / ELSE statements; and apply the equation to each individual row of data from the source Channel.

Important: These instructions are a continuation from the topic, "Creating a Calculated Channel". From step one, it is assumed that you are back at the Configure Sites Page, after having completed setup of a new Calculated Channel.

1. Select the Calculated Channel you just created. Resuming from the Configure Sites page, expand the Choose Site list and select the Site that your new Calculated Channel resides in. Then, from the Choose Calculated Channel list, select the new Channel you just created.

Note: No action is required for the Choose Channel option.

1. Click . This will direct you to the respective page, where summarizing information on the Calculated Channel is displayed.
2. Click . This will take you to the page where you will configure the calculation. This page has three distinct sections - the following steps take you through each part, beginning from the top of the page.
3. Provide a Calculation Name and Description (both are optional).
4. Select the calculation Type from the drop-down list. Many of the options here are functions available in FlowWorks. For this example we will choose Formula so that we can manually input a mathematical equation, that is to be applied to all incoming data. Upon choosing this option, the bottom section of the screen will update, revealing further questions that must be answered to set up the calculation.

Note: Calculation type called Circle is not present in the Type list because it is used as part of a formula. To use Circle, select Formula, and incorporate CIRCLE into your equation appropriately (example is shown in the following images). Please see topic, "About FACE Formula" for further information.

5. If desired, set a Start Date and End Date. The calculation will be applied only to data that falls within these dates. You can leave either of these fields blank if you want to have the calculation apply to all old and new data from the source Channel.
6. Define the Source Components - this is where you specify the source Channel(s). You can have one to many Source Components. For each one, select the source Site and Channel, then assign to it a unique Variable Name (any letter). Use to add more Source Components.

Important: The Variable Name must be unique for each Source Component in this list. If two Source Components have the same Variable Name, FACE will not be able to output a calculation. This means that you can have up to 26 unique variables for one calculation.

7. Choose a Lookup Table (optional). The Lookup function enables the use of a Lookup Table in a formula. Choose a desired Lookup Table from the drop-down list and then reference it in the formula along with an input channel. For example, you could write "LOOKUP (A)".
8. Define the equation - in the Define Equation box, use basic math syntax, trigonometric formulas, the Circle equation and/or IF / ELSE statements, referencing the variables with the names you previously assigned where appropriate. In this example, we use the CIRCLE function.
9. Expand Advanced Options, and select all options that you wish to apply. From here, you can do the following:

• Prevent the formula from creating results with a value of NULL. By checking this box, any time your calculation would have created a datapoint with the value NULL, instead it will not create a datapoint at all. to remove NULL values from an existing Channel, check this box and write a formula 'A' where A is the channel you want to clear.
• Treat missing component values as zero. By default, when using more than one source component, the data for all the sources must occur at the same timestep in order to produce a calculated result. If the data occurs at different timesteps (i.e. does not line up), no value can be calculated. By checking this box, FACE will assume a zero value for any component channels whose data is missing. This allows you to merge sets of data with different time steps.
• Add this calculation to other Sites. This list only contains Sites that have a calculated channel with the same name; and all of the required source component Channels. Take caution when applying this option to non-identical calculations to prevent unintended consequences and inaccurate calculation results.

10. Click . You will be directed back to the View Calculated Channels page, where the new calculation will appear in a list.

Your new Calculated channel is now set up ready for use. All incoming data from the Source Components will be copied into this Calculated Channel, where the conversion formula will be automatically applied to generate virtual data. You can use this Channel in lieu of the original Channel with any of the analysis, reporting and data management tools offered by FlowWorks.

## Configuring a Calculated Channel Using a Function (General Steps)

FACE has a host of predefined mathematical functions that can be applied to each individual row of data from the source Channel. For example , you can use the Time-Weighted Average function to compute the daily average flow from a 5-minute flow Channel.

Important: These instructions are a continuation from the topic, "Creating a Calculated Channel". From step one, it is assumed that you are back at the Configure Sites Page, after having completed setup of a new Calculated Channel.

1. Select the Calculated Channel you just created. Resuming from the Configure Sites page, expand the Choose Site list and select the Site that your new Calculated Channel resides in. Then, from the Choose Calculated Channel list, select the new Channel you just created.
2. Click . This will direct you to the respective page, where summarizing information on the Calculated Channel is displayed.
3. Click . This will take you to the page where you will configure the calculation. This page has three distinct sections - the following steps take you through each part, beginning from the top of the page.
4. Provide a Calculation Name and Description (both are optional).
5. Select the calculation Type from the drop-down list. Many of the options here are functions - choose one that applies to you. In this example, we will choose time-weighted average. Upon choosing any of these options, the bottom-most section of the screen will update, revealing relevant questions for calculation setup.

6. Ignore Start Date and End Date. We want this Channel to calculate Flow for all past, present, and future data.
7. If desired, set a Start Date and End Date. The calculation will be applied only to data that falls within these dates. You can leave either of these fields blank if you want to have the calculation apply to all old and new data from the source Channel.
8. Setup the function. The image below shows an example of setup for time-weighted average.

9. Expand Advanced Options if you would like to add the calculation to other Sites.
10. Click . You will be directed back to the View Calculated Channels page, where the new calculation will appear in a list.

Your new Calculated channel is now set up and ready for use. All incoming data from the source Channel(s) will be copied into this Calculated Channel, where the function will be automatically applied to generate virtual data. You can use this Channel in lieu of the original Channel with any of the analysis, reporting and data management tools offered by FlowWorks.