> ## 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.

# Discount catalogue

> The discount catalogue with the orders that used each code: orders, order value, discount given and sales per discount, by type, method and status.

The discount catalogue with the orders that used each code: orders, order value, discount given and sales per discount, by type, method and status.

## Example

```sql theme={null}
FROM discount_catalog
  SHOW discounts, active_discounts
  GROUP BY discount_title
  SINCE startOfMonth(-1m) UNTIL today
  ORDER BY discounts DESC
```

## Metrics

| Metric | Type | Description |
| - | - | - |
| `discounts` | Number | Discounts in the catalogue. |
| `active_discounts` | Number | Discounts active now. |
| `orders_with_discount` | Number | Orders in the period that used the discount's code. |
| `discounted_order_value` | Currency | What the orders using the code came to. |
| `discount_amount` | Currency | What the orders using the code were discounted. |
| `discount_return` | Number | Order value for each unit of discount given: what the discount brought in for what it cost. |

## Dimensions

| Dimension | Description |
| - | - |
| `discount_title` | The discount's title. |
| `discount_type` | basic, bxgy (buy X get Y), free\_shipping or app. |
| `discount_method` | code or automatic. |
| `discount_status` | active, scheduled or expired. |

## Filters

| Filter | Type | Description |
| - | - | - |
| `discount_title` | Text | The discount's title. |
| `discount_type` | Text | basic, bxgy (buy X get Y), free\_shipping or app. |
| `discount_method` | Text | code or automatic. |
| `discount_status` | Text | active, scheduled or expired. |

## 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 `order.name`). Each record's page lists its fields.

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

## Related datasets

* [Draft orders](https://docs.queryful.app/queryfulql/datasets/draft_orders.md)
* [Abandoned checkouts](https://docs.queryful.app/queryfulql/datasets/abandoned_checkouts.md)
* [Discounts](https://docs.queryful.app/queryfulql/datasets/discounts.md)


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