> ## Documentation Index
> Fetch the complete documentation index at: https://help.lobyco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Find customers by what they buy

> Build a segment from what customers buy, such as everyone who spent 500 or more in one chain in the last 7 days, and count them before anything reaches them.

This page shows you how to build an audience from what customers buy, and count it before anything reaches them. The worked example, spend in a chain, finds customers who spent 500 or more in one chain in the last 7 days. Three more examples change only the rules: buyers of a product, items bought in a store, and frequent shoppers by profile.

## What you'll build

```mermaid theme={"system"}
flowchart LR
    A["Member segment<br/>Segment rules"] --> B["Push or Offer"]
```

On the campaign's canvas, a **Member segment** block picks out the customers. The block after it, such as a **Push** or an **Offer**, decides what they get. Every example on this page uses these two blocks. Only the rules in the **Member segment** change.

## Segment rules

| Attribute | Set it to | What it does here |
| - | - | - |
| **Store chain name** | **In**, with the chain picked | Keeps only purchases made in that chain. |
| **Amount spent** | **Greater or equal** 500 | Sets the spend threshold. |
| **Purchase date** | **Between**, **Float**, **From** 7 **to** 0 | Looks at the last 7 days. It moves forward every time the segment runs. |

Joined by **AND**, the three rules look at the same purchases. So **Amount spent** adds up only what the customer spent in that chain, in those 7 days.

## Add a Member segment

1. Open the campaign's **Orchestration** view. To start a new campaign there, see [Create a campaign](/business-documentation/campaigns/create-a-campaign#create-the-campaign).
2. From **Segment** in the **Block library**, drag **Member segment** onto the canvas.
3. Double-click the block, then choose **From Scratch**.
4. On **Add Segment details**, enter a **Member segment name**, such as *Spent 500+ in the chain, last 7 days*.

## Add the rules

Open **Segment attributes**. All three attributes are in the **Purchase** category.

1. Double-click **Store chain name**. Choose **In**, then pick the chain from the list.
2. Double-click **Amount spent**. Choose **Greater or equal** and enter 500.
3. Double-click **Purchase date**. Choose **Between**, then **Float**, and set **From** 7 and **to** 0.
4. Leave the rules joined by **AND**.
5. Select **Save**.

![The Segment attributes tab of a Member segment named Spent 500+ in the chain, last 7 days. The Segment builder reads The segment includes customers who … and holds three rules joined by AND badges: Store chain name set to In, with the chain Daily Tasty picked; Amount spent set to Greater or equal, 500; and Purchase date set to Between, with Float selected, from 7 to 0 days ago. Each rule ends with the note Data from today may be incomplete.](https://mintcdn.com/lobyco-4c9fb3ad/WYxSmfbwe1zr5xYw/images/usecase-03-chain-spend-and-date-rules.png?fit=max\&auto=format\&n=WYxSmfbwe1zr5xYw\&q=85\&s=67e56747d573a6e0dfdf4adb178b75cc)

*The chain, spend and date rules, joined by AND*

[Create a segment](/business-documentation/audiences-and-data/create-a-segment#add-your-rules) covers the builder in more detail.

## Connect a push or an offer

From **Activity**, drag the block that acts on the audience, such as a **Push**. Then connect the **Member segment** to it. To give them an offer instead, connect the segment to an **Offer** block before you open it. Its **Type** list then shows only the types a flow can hand out, such as **Gift**. See [Offer types](/business-documentation/activities/offers/offer-types) and [Orchestration canvas](/business-documentation/campaigns/orchestration-canvas#add-what-happens).

Don't publish the flow yet. Count it first.

## Check the result

1. Open the chevron beside **Publish** on the **Member segment** and choose **Count**. It saves the canvas, then counts the customers at each segment and operator block. Nothing is sent and no one gets an offer.
2. The canvas switches to **History**, with the run selected. Wait for it to show **Done**.
3. Select the **Member segment** block. Its **Count** is the number of customers who spent 500 or more in the chain in the last 7 days.

If the count is much higher than you expect, check that all three rules are joined by **AND**. A rule joined by **OR** widens the audience.

When the count looks right, publish the flow and set its schedule. [Schedule a campaign and check its results](/business-documentation/use-cases/schedule-a-campaign-and-check-its-results) shows how.

## More examples

Each example uses the same blocks and steps as the worked example. Only the segment's name and its rules change, in [Add the rules](#add-the-rules).

### Buyers of a product

This one finds customers who bought a coffee brand in the last 30 days. Name the segment something like *Bought the coffee brand, last 30 days*.

| Attribute | Set it to | What it does here |
| - | - | - |
| **Product** | The coffee brand, picked in the **Product** picker | Finds customers who bought any of the products you tick. |
| **Purchase date** | **Between**, **Float**, **From** 30 **to** 0 | Looks at the last 30 days. It moves forward every time the segment runs. |

Without a **Purchase date** rule, **Product** looks at the last 90 days. So for a 90-day window, **Product** on its own is enough.

Add the rules like this:

1. In the **Purchase** category, double-click **Product**. The **Product** picker opens.
2. Search or browse for the brand. Tick its product group, or tick single products in the column furthest to the right. Then select **Add criteria**.
3. Double-click **Purchase date**. Choose **Between**, then **Float**, and set **From** 30 and **to** 0.
4. Leave the rules joined by **AND**.
5. Select **Save**.

![The Segment attributes tab of a Member segment named Bought the coffee brand, last 30 days. The Segment builder reads The segment includes customers who … and holds two rules joined by an AND badge. The Product rule has no operator and shows the picked product group by its path: Root, Level 1 Food, Level 2 Beverages, Level 3 Coffee & Tea. The Purchase date rule is set to Between, with Float selected, from 30 to 0 days ago. Each rule ends with the note Data from today may be incomplete.](https://mintcdn.com/lobyco-4c9fb3ad/WYxSmfbwe1zr5xYw/images/usecase-02-product-and-purchase-date-rules.png?fit=max\&auto=format\&n=WYxSmfbwe1zr5xYw\&q=85\&s=79893c76f58f06e63932f65e63f01b72)

*A Product rule and a Purchase date rule, joined by AND*

The block's **Count** is the number of customers who bought the brand in the last 30 days. A count of 0 means the **Product** picker has the wrong products ticked, or nobody bought them in the window. Open the block and check the **Product** rule first.

### Items bought in a store

This one looks at how many items customers bought, not which ones. It finds customers who bought between 100 and 200 items in one store during September. Name the segment something like *100–200 items in the store, September*.

| Attribute | Set it to | What it does here |
| - | - | - |
| **Store name** | **In**, with the store picked | Keeps only purchases made in that store. |
| **Items bought** | **Between**, **From** 100 **To** 200 | Sets the range of items, both numbers included. |
| **Purchase date** | **Between**, **Fixed**, 1 to 30 September | Looks at September only. A **Fixed** window stays put, however often the segment runs. |

Joined by **AND**, the three rules look at the same purchases, as in the worked example. So **Items bought** counts only the items bought in that store, in September.

**Items bought** counts items, not purchases. A customer who bought 120 items in 3 visits has an **Items bought** of 120 and a **Receipt count** of 3. To find customers by how often they shop, see [Frequent shoppers by profile](#frequent-shoppers-by-profile).

Add the rules like this. All three attributes are in the **Purchase** category.

1. Double-click **Store name**. Choose **In**, then pick the store from the list.
2. Double-click **Items bought**. Choose **Between**, then enter 100 in **From** and 200 in **To**.
3. Double-click **Purchase date**. Choose **Between**, then **Fixed**, and pick 1 September as the start and 30 September as the end.
4. Leave the rules joined by **AND**.
5. Select **Save**.

![The Segment attributes tab of a Member segment named 100–200 items in the store, September. The Segment builder reads The segment includes customers who … and holds three rules joined by AND badges: Store name set to In, with the store MegaTasty picked and Manual input left unticked; Items bought set to Between, From 100 To 200; and Purchase date set to Between, with Fixed selected, From 01/09/2026 To 30/09/2026. The sidebar on the left lists the attribute categories, from Membership to App Data.](https://mintcdn.com/lobyco-4c9fb3ad/WYxSmfbwe1zr5xYw/images/usecase-04-store-items-and-date-rules.png?fit=max\&auto=format\&n=WYxSmfbwe1zr5xYw\&q=85\&s=05611f58dbab1b6024a9ced6e73c5515)

*The store, items and date rules, joined by AND*

The block's **Count** is the number of customers who bought 100 to 200 items in the store in September. A **Fixed** window finds the same customers every time, so this audience suits a single run more than a daily schedule. [Schedule and run a campaign](/business-documentation/campaigns/schedule-and-run-a-campaign) covers both.

### Frequent shoppers by profile

A profile attribute on its own rarely makes a good audience. Combined with how often customers shop, it does. This one finds women who made 5 or more purchases in the last 30 days. Name the segment something like *Women, 5+ purchases, last 30 days*.

| Attribute | Set it to | What it does here |
| - | - | - |
| **Gender** | **Equal**, with the gender picked | Keeps only the customers whose profile has that gender. |
| **Receipt count** | **Greater or equal** 5 | Sets how many purchases make a frequent shopper. |
| **Purchase date** | **Between**, **Float**, **From** 30 **to** 0 | Looks at the last 30 days. It moves forward every time the segment runs. |

Lobyco Nexus keeps profile attributes, such as **Gender** and **Age**, in the **Membership** category. A **Membership** attribute isn't about purchases, so the date rule doesn't apply to it. **Receipt count** and **Purchase date** are **Purchase** attributes, so together they count the purchases made in the last 30 days.

**Receipt count** counts purchases, not items. A customer who made 5 visits and bought 40 items has a **Receipt count** of 5. To find customers by how many items they buy, see [Items bought in a store](#items-bought-in-a-store).

Add the rules like this:

1. In the **Membership** category, double-click **Gender**. Choose **Equal**, then pick the gender from the list.
2. In the **Purchase** category, double-click **Receipt count**. Choose **Greater or equal** and enter 5.
3. Double-click **Purchase date**. Choose **Between**, then **Float**, and set **From** 30 and **to** 0.
4. Leave the rules joined by **AND**.
5. Select **Save**.

The values in the **Gender** list come from your customer data, so they can read differently from one programme to the next.

The block's **Count** is the number of customers who match all three rules. Customers with no gender recorded aren't in the count. A rule only finds customers who have a value for its attribute.

## Variations

Each variation changes, adds or removes one rule. The example's other rules stay as they are.

| Starting from | To find | Change |
| - | - | - |
| Spend in a chain | The same customers in another chain | Pick that chain in **Store chain name**. Or [copy the segment](/business-documentation/audiences-and-data/manage-saved-segments#copy-a-segment), if you saved it, and change the chain in the copy. |
| Spend in a chain | Spend across two chains together | Pick both chains in **Store chain name**. **Amount spent** then adds up what they spent in either chain. |
| Spend in a chain | Spend in one store | Use **Store name** instead of **Store chain name**. |
| Spend in a chain | Customers who spent less | Use **Less than** in **Amount spent**, for example to reach light spenders. |
| Buyers of a product | Buyers of a whole category | Tick the category in the **Product** picker instead of single products. |
| Buyers of a product | Customers who bought at least 3 of it | Add **Items bought** with **Greater or equal** 3. It counts only the products in the **Product** rule. |
| Buyers of a product | Customers who spent at least 20 on it | Add **Amount spent** with **Greater or equal** 20. It counts only what they spent on those products. |
| Buyers of a product | A longer or shorter window | Change **From** in the **Purchase date** rule. |
| Items bought in a store | Volume across the whole chain | Use **Store chain name** instead of **Store name**. |
| Items bought in a store | Volume across every store | Leave out the store rule. |
| Items bought in a store | Every high-volume shopper | Use **Greater or equal** 100 in **Items bought**, with no upper limit. |
| Items bought in a store | A rolling window, such as the last 30 days | Use **Float** in **Purchase date**, **From** 30 **to** 0. |
| Items bought in a store | One big shop, such as 100 items in a single visit | Use **Items bought (single receipt)** instead of **Items bought**. It looks at each receipt on its own. |
| Frequent shoppers by profile | An age group instead | Use **Age** with **Between**, such as **From** 25 **To** 34, in place of **Gender**. |
| Frequent shoppers by profile | Loyal shoppers | Raise **Receipt count**, such as **Greater or equal** 10. |
| Frequent shoppers by profile | Occasional shoppers | Use **Between** in **Receipt count**, such as **From** 1 **To** 2. |
| Frequent shoppers by profile | Frequent shoppers with big baskets | Add **Amount spent**, such as **Greater or equal** 1000, to the same rules. |

## Related

* [Create a segment](/business-documentation/audiences-and-data/create-a-segment) — the segment builder, the **Product** picker, **Fixed** and **Float** date windows, and joining rules with **AND** and **OR**
* [Segment attributes](/business-documentation/audiences-and-data/segment-attributes) — every attribute and its operators, and why most **Purchase** attributes look back 90 days
* [Split a segment into groups](/business-documentation/use-cases/split-a-segment-into-groups) — giving parts of one audience different treatment
* [Reuse a saved segment](/business-documentation/use-cases/reuse-a-saved-segment-across-campaigns) — saving a segment once and using it in every campaign
* [Schedule a campaign and check its results](/business-documentation/use-cases/schedule-a-campaign-and-check-its-results) — publishing the flow on a daily schedule


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.