## Overview

When you run a report Yellowfin performs calculations on the data returned from the database. With analytic functions you can further transform your data for analysis purposes by applying predefined calculations.

Functions are similar to aggregate functions. You simply select the field you wish the function to apply to, and choose the function you wish to use.

## Available Functions

Yellowfin comes with a set of pre-defined functions. However, your administrator may add in additional functions specifically for your organisation or reporting needs. Expand the following to see the lists of functions available:

## Applying a Function

### Report Data page

To apply a function to a field on the Report Data page (Step 1 of the Report Builder)

- Drag the field onto your report.
- Highlight the field and click the function icon.
- The function popup will open. This will display a range of functions available for the particular function type. For example if you have chosen a date variable then only date functions will be displayed.
- Select the function type and then the specific function. By highlighting the functions available the description will appear at the bottom of the function list.

- If appropriate select the aggregation. For example you can create a running total for SUM of revenue rather than revenue. This will pre-aggregate your data prior to the running total being applied.
- Click
**Save**to close and save your function.

- When you run your report your column will now have the function formula applied.

### Report Preview page

To apply a function to a field on the Report Preview/Format page

- Click on the drop down arrow on the column title of the field you want to apply the function to
- Select
**Add f( x )**from the list - The function popup will open. This will display a range of functions available for the particular function type. For example if you have chosen a date variable then only date functions will be displayed.
- Select the function type and then the specific function. By highlighting the functions available the description will appear at the bottom of the function list.

- If appropriate select the aggregation. For example you can create a running total for SUM of revenue rather than revenue. This will pre-aggregate your data prior to the running total being applied.
- Click
**Save**to close and save your function. - Your report will now run, with an extra field, a copy of the original selected field with the function applied.

**Note:** if you apply a function outside of the Report Data page, Yellowfin will create a duplicate of the selected field, ensuring you have the original value, and then a copy with the function applied.

### Chart Builder

To apply a function to a field on the Chart Builder page

- Generate your chart
- Select
**+ Function**below your list of series

- Select the metric you wish to apply the function to

- The function popup will open. This will display a range of functions available for the particular function type. For example if you have chosen a date variable then only date functions will be displayed.
- Select the function type and then the specific function. By highlighting the functions available the description will appear at the bottom of the function list.

- If appropriate select the aggregation. For example you can create a running total for SUM of revenue rather than revenue. This will pre-aggregate your data prior to the running total being applied.
- Click
**Save**to close and save your function. - Your report will now run, with an extra field, a copy of the original selected field with the function applied.

**Note:**if you apply a function outside of the Report Data page, Yellowfin will create a duplicate of the selected field, ensuring you have the original value, and then a copy with the function applied.

## Removing a Function

To remove a function from an item, do one of the following:

- Reset the field by selecting the metric and clicking the clear button.

- Remove the field from the report entirely

## Statistical Functions

Yellowfin has a set of statistical functions which you can apply to your data. These include regressions and moving averages. These are applied as analytical functions and can result in trend lines such as the example below.