# Statistical streams

{% hint style="info" %}
User permission: Financial Statements > Manage Custom Statements and Administration > Databases and Sync
{% endhint %}

You can add statistical streams (actuals and budget) to your financial statements to bring in data that doesn't come through with your General Ledger data, such as bonuses, rent, and quantity of units sold.

Statistical streams behave just like any other stream you add to a database, however, the calculations you can create from statistical streams significantly enhance the analysis capabilities in your financial statements. For example, you can add a statistical stream for units sold, then add calculations to the statement that allow you to analyze the Gross and Net Profit per unit sold.

Watch the videos below for demonstrations.

## Add the statistical stream to the database <a href="#usestatisticalstreamsinafinancialstatement-addthestatisticalstreamtothedatabase" id="usestatisticalstreamsinafinancialstatement-addthestatisticalstreamtothedatabase"></a>

If you have the required permissions, you complete this step in [Designer](/administration/designer.md). If not, use the [Upgrades and services form](/other-information/more-help-and-support.md#upgrades-and-services) to request this to be done for you.

{% hint style="success" %}
You add a *budget* statistical stream in the same way, but there are a few extra steps, as stated below. See the [Add a budget file to a financial database](/administration/designer/add-a-budget-file-to-a-financial-database.md) for related information.
{% endhint %}

1. Prepare the statistical data items and add them as a sync source in Phocas (if it is not already there). A statistical stream typically contains a date, measure(s) and sub dimensions, which ideally correspond with the existing dimensions in the financial database.
2. Open the financial database design and ensure the statistical data item is available in the data sources panel.
3. Add a new stream > open the **Stream** window > give the stream a meaningful name, and select the **Statistical** checkbox. If it's a budget statistical stream, select the **Variance Stream** checkbox also. Click **Save**.&#x20;

   <div align="left"><figure><img src="/files/pX5LhASr8zJ9yoWXOw8D" alt="" width="267"><figcaption></figcaption></figure></div>
4. Drag in the data item(s) that contain the statistical data.

   <figure><img src="/files/lcIZdnmigVdSJr0kPJX3" alt="" width="825"><figcaption></figcaption></figure>
5. Map the statistical data to the database. If it's a budget statistical stream, map to the same dimensions and measures as the actual statistical stream.
6. Save your design changes and build the database to apply those changes.
7. In the case of a budget statistical stream, proceed to map the budget statistical stream to the budget data set in Financial Statements. See [Manage streams and scenarios](/financial-statements/managing-statements/manage-streams-and-scenarios.md).

## View the statistical data in the financial statement <a href="#usestatisticalstreamsinafinancialstatement-viewthestatisticaldatainthefinancialstatement" id="usestatisticalstreamsinafinancialstatement-viewthestatisticaldatainthefinancialstatement"></a>

After you add the statistical stream and build the database, open the financial database, [click a stream dimension ](/financial-statements/using-statements/filter-the-financial-information.md)(this moves you into the Analytics grid), then select the stream.

Use the **Streams** menu to add the budget stream or scenario to the grid. See [Change the streams and scenarios](/financial-statements/using-statements/customize-your-view-financial-statements/change-the-current-data.md).

<div align="left"><figure><img src="/files/3TwD7WS4dsw8kRyIJMCY" alt="" width="526"><figcaption></figcaption></figure></div>

You can now use the range of Analytics tools to drill deeper into your data, all the way down to the transaction level. See the [Analytics pages](https://docs.phocassoftware.com/analytics/) for detailed information.

Alternatively, click the **Summary** button to return to the Financial Statements module, where you can add calculations that reference the statistical stream.

## Add a calculation based on a statistical stream <a href="#usestatisticalstreamsinafinancialstatement-addacalculationbasedonastatisticalstream" id="usestatisticalstreamsinafinancialstatement-addacalculationbasedonastatisticalstream"></a>

In Financial Statements, click **Statement** > **Manage statements** to open the **Manage statements** screen, then select the statement to open its setup. [Add a calculation](/financial-statements/managing-statements/customize-a-financial-statement/customize-calculations.md) using the [STAT function](/financial-statements/managing-statements/customize-a-financial-statement/customize-calculations/functions-for-profit-and-loss-calculations.md#functionsforprofitandlosscalculations-stat) to refer to the statistical stream. Save your changes.

<div align="left"><figure><img src="/files/VYTO7Sw7meypjMtvwy2p" alt="" width="618"><figcaption></figcaption></figure></div>

The statement automatically updates to display the new calculation row.

<figure><img src="/files/LzzAej4Z8DZr5SzTHSsU" alt="" width="893"><figcaption></figcaption></figure>

{% hint style="success" %}
You can create charts based on your statistical stream calculations, then [add them to your dashboard](/financial-statements/using-statements/add-financial-analysis-to-a-dashboard.md).
{% endhint %}

***

## Videos

{% hint style="success" %}
Watch this PUG Training video: [Ratios and statistical streams](https://www.phocassoftware.com/customer/training-series/financial-statements#session3) (jump to 9.45)
{% endhint %}

{% embed url="<https://phocassoftware.wistia.com/medias/7g7t9xnref>" %}
Bring statistical streams into a Financial Statements
{% endembed %}

{% embed url="<https://phocassoftware.wistia.com/medias/u35g5q0j03>" %}
Combine statistical and financial data for better business
{% endembed %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.phocassoftware.com/financial-statements/adding-data/use-statistical-streams.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
