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

# Customer segments

> The store's customer segments today: customers in each, and what they have spent and ordered in all.

The store's customer segments today: customers in each, and what they have spent and ordered in all.

## Example

```sql theme={null}
FROM segments
  SHOW segment_members, segment_amount_spent
  GROUP BY segment_name
  ORDER BY segment_members DESC
```

## Metrics

| Metric | Type | Description |
| - | - | - |
| `segment_members` | Number | Customers in the segment. |
| `segment_amount_spent` | Currency | What the segment's customers have spent in all. |
| `segment_orders` | Number | The segment's customers' orders in all. |
| `segment_amount_spent_per_customer` | Currency | Lifetime spend per customer in the segment. |
| `segment_average_order_value` | Currency | Spend per order across the segment's customers. |

## Dimensions

| Dimension | Description |
| - | - |
| `segment_name` | The customer segment. |
| `segment_query` | The conditions that define the segment, as written in Shopify. |

## Filters

| Filter | Type | Description |
| - | - | - |
| `segment_query` | Text | The conditions that define the segment, as written in Shopify. |
| `segment_name` | Text | The customer segment. |

## Linked records

Fields of the records this dataset reaches can be shown, grouped by and filtered on, written with a dot after the record (for example `customer.name`). Each record's page lists its fields.

| Write | Record | Reached through |
| - | - | - |
| `customer.<field>` | [Customer](https://docs.queryful.app/queryfulql/records/customer.md) | Customer |
| `customer.company.<field>` | [Company](https://docs.queryful.app/queryfulql/records/company.md) | Customer › Company |
| `shop.<field>` | [Store](https://docs.queryful.app/queryfulql/records/shop.md) | Store |

## Related datasets

* [Customers](https://docs.queryful.app/queryfulql/datasets/customers.md)
* [Companies](https://docs.queryful.app/queryfulql/datasets/companies.md)
* [Customer addresses](https://docs.queryful.app/queryfulql/datasets/customer_addresses.md)
* [Customer journey visits](https://docs.queryful.app/queryfulql/datasets/journey_visits.md)


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