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

# Companies

> B2B orders by company and location: companies ordering, orders, order value and average order value.

B2B orders by company and location: companies ordering, orders, order value and average order value.

## Example

```sql theme={null}
FROM companies
  SHOW companies, company_orders
  GROUP BY company_name
  SINCE startOfMonth(-1m) UNTIL today
  ORDER BY companies DESC
```

## Metrics

| Metric | Type | Description |
| - | - | - |
| `companies` | Number | B2B companies that ordered in the period. |
| `company_orders` | Number | Orders from B2B companies. |
| `company_order_value` | Currency | What B2B companies' orders came to. |
| `company_average_order_value` | Currency | Order value per B2B order. |

## Dimensions

| Dimension | Description |
| - | - |
| `company_name` | The B2B company. |
| `company_location_name` | The company location the order was for. |
| `company_location_country` | The location's shipping country. |

## Filters

| Filter | Type | Description |
| - | - | - |
| `company_name` | Text | The B2B company. |
| `company_location_name` | Text | The company location the order was for. |
| `company_location_country` | Text | The location's shipping country. |

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

| Write | Record | Reached through |
| - | - | - |
| `company.<field>` | [Company](https://docs.queryful.app/queryfulql/records/company.md) | Company |
| `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

* [Customers](https://docs.queryful.app/queryfulql/datasets/customers.md)
* [Customer segments](https://docs.queryful.app/queryfulql/datasets/segments.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.