# Set up a database

The available configuration options depend on the data in your selected database. As you move through the steps, preview how the segmentation works and adjust the settings as required.

After setup, you can edit or delete the configuration at any time.&#x20;

1. In the navigation menu, click **Insights** (underneath Analytics). A list of your unconfigured databases displays.
2. Click the database you want to configure. The **Customer segmentation 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), and [**Frequency, Monetary, and Recency**](#frequency-monetary-and-recency) sections below for more details.

<figure><img src="/files/C4GULDX01fzblYrFNC31" alt=""><figcaption></figcaption></figure>

### Data

1. Select the data **stream** that contains the sales transactions.
2. Select **customer dimension**. This is used for the segmentation calculation.
3. Select the **property** **(name)**. This is the information you'll see about the customer in the segmentation summary table.
4. Select the sales value **measure**. This is the value used to record each purchase, for example **US dollars**. A preview table appears on the right, so you can check the data (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 click the link, the dashboard opens, allowing you to drill deeper into the insights.&#x20;
6. Select the **Property identifying individual purchases**. This determines how transaction frequency and related metrics are calculated. Available options are sourced from transaction-level fields in the dataset (for example, Invoice Number, Transaction ID, Document Number, or Order Number) and may vary by organization.
7. Click **Next**.

### Segmentation

Select the segmentation grouping to apply:

* **5 groups:** This is a simplified version with fewer, broader customer segments.
* **10 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 see what the grouping will look like.

Click **Next**.

### **Frequency, Monetary, and Recency**

Steps (tabs) three to five allow you to classify your customers based on frequency, monetary value and recency buckets. Phocas automatically calculates the thresholds in each bucket using statistical techniques. For example:

* **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 do anything here, but you can adjust the thresholds by editing the values in the boxes. The segmentation calculation updates automatically.

Click **Next** to move from the **Frequency** tab through to the **Monetary** and **Recency** tabs.

On the **Recency** tab (final step), click **Done**. The new **Customer segmentation** page opens, with a summary, chart and other elements based on the results of your database setup.&#x20;


---

# 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/insights/manage-customer-segmentation/set-up-a-database.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.
