> For the complete documentation index, see [llms.txt](https://docs.phocassoftware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.phocassoftware.com/sales-insights/set-up-and-manage-sales-insights/set-up-a-database.md).

# Set up a database

Configure your database so Sales Insights can segment your customers and show the right information in customer profiles.

{% hint style="info" %}
You need Phocas administrator access, a Sales Insights license, and access to the database. See [Manage customer segmentation](/sales-insights/set-up-and-manage-sales-insights/manage-customer-segmentation.md).
{% endhint %}

The available configuration options depend on the data in your selected database. As you move through the setup, preview how your data is being used and adjust the settings as required.

{% embed url="<https://phocassoftware.wistia.com/s/5v5v8z5r0rwp53n>" %}
Set up a database
{% endembed %}

After setup, you can [edit or delete the configuration](/sales-insights/set-up-and-manage-sales-insights/edit-customer-segmentation.md).

1. In the navigation menu, select **Sales Insights** (underneath Analytics). A list of your unconfigured databases displays.
2. Select the database you want to configure. The **Insights setup** page opens.
3. Check the database name at the top of the page to confirm you selected the correct one.
4. Complete the setup steps (tabs). See the [Data](#data), [Segmentation](#segmentation), [Frequency, Monetary, and Recency](#frequency-monetary-and-recency), and [Customer profile](#customer-profile) sections below for more information.

<figure><img src="https://3487206470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQGQGMazAMTVRZA3vjjb5%2Fuploads%2FHc7tqQlcPxuoy4faBUMJ%2FScreenshot%202026-10-09%20at%2009.25.46.png?alt=media&amp;token=4663e494-282b-4cc5-bfa6-3ae4248933d1" alt=""><figcaption></figcaption></figure>

### Data

1. Select the **Stream** that contains the sales transactions.
2. Select the **Customer dimension**. This is used for the segmentation calculation.
3. Select the **Customer property (name)**. This is the information you'll see about the customer in the segmentation summary table.
4. Select the **Measure covering the value of each purchase**, then choose the **Currency** to display. A preview table appears on the right, so you can check that the customer codes, names, and sales volumes are correct.
5. Select the **Customer scorecard**. This creates a link between the customers listed in the segmentation summary table and one of your [dashboards](/basics/dashboards/use-dashboards.md). When you select the link, the dashboard opens so you can explore the customer data in more detail.
6. Select the **Property identifying individual purchases**. This determines how transaction frequency and related metrics are calculated. The available options come from transaction-level fields in your data, such as Invoice Number, Transaction ID, Document Number, or Order Number, and might vary by organization.
7. Select **Next**.

### Segmentation

Choose how many groups to use to segment your customers. Select the segmentation grouping to apply:

* **Five groups:** This is a simplified version with fewer, broader customer segments.
* **Ten groups** (default): This is the standard version with more granular customer segments.

Your selection is reflected in the chart on the right, so you can preview what the grouping will look like.

Select **Next**.

### Frequency, Monetary, and Recency

Use steps three to five to classify your customers based on frequency, monetary value, and recency. Sales Insights automatically calculates the thresholds from your data. The following are examples; your thresholds will depend on your database:

* **Frequency**: Very frequent customers purchase more than 15 times per year.
* **Monetary value**: High-value customers spend over $53,000.
* **Recency**: Recent customers purchased in the last 29 days.

You don't need to change the calculated thresholds, but you can adjust them by editing the values in the boxes. The segmentation calculation updates automatically.

Select **Next** to move from **Frequency** through to **Monetary** and **Recency**.

On the **Recency** step, select **Next** to continue to step 6, **Customer profile**.

### Customer profile

Map the product and sales data used to generate customer profiles and opportunities, so the information displayed is relevant to your business.

An administrator must complete the customer profile setup before users can view customer profiles and opportunities.

For an existing database without customer profile mappings, opening a customer profile takes you to this setup step.

1. Select the **Product dimension** and **Product property (name)**. The property determines the product name displayed on the Customer profile page.
2. Optional: Select an **Additional product property** to display more information about the product.
3. Optional: Select the **Product group dimension**, then select the **Product group property (name)**.
4. Select the **Sales rep dimension** and **Sales rep property (name)**. The property determines the sales rep name displayed on the Customer profile page.
5. Select the **Quantity measure**.
6. Optional: Select the **Margin measure (% based)**.
7. Check the **Data preview** to confirm the product, product group, and sales rep information is what you expect.
8. Select **Done**.

After you complete the full database setup, the **Customer segmentation** page opens with a summary, chart, and other information based on your configuration.

{% hint style="info" %}
When you save customer profile mappings for the first time or change them, opportunities are generated automatically in the background. This may take 10 minutes or more, depending on the size of your customer data. Customer profile changes aren't reflected on the **Customer profile** page until processing completes. You can check the status in the top-right corner of the page to see whether opportunities have been generated.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.phocassoftware.com/sales-insights/set-up-and-manage-sales-insights/set-up-a-database.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
