Creating reports for B2B sales

You can create custom data explorations using the new Shopify Analytics to display information about your B2B sales.

The guides below outline a few examples of common B2B reports that you might want to consider creating and customizing to suit your needs. Each guide gives an explanation of how to create the exploration manually using the configuration panel, or by running a ShopifyQL query.

Available B2B dimensions and filters in reports

When creating an exploration, there are some data configuration components available that you can leverage to tailor your reports to a B2B context. You can use the following B2B labels as a report dimension or filter for any sales-related metric, such as Net sales or Returns:

  • Is B2B order
  • Company ID
  • Company location ID
  • Company location name
  • Company name

For example, if you want to create a sales report that displays data from only your B2B orders, then you can apply the filter Is B2B order > Yes to your exploration to filter out data from non-B2B orders.

Learn more about dimensions and filters in the new Shopify Analytics' configuration panel.

Example: Create a sales over time report comparing B2B and D2C sales

You can create a sales report that displays net sales over time for both B2B sales and direct-to-consumer (D2C) sales. This report is particularly valuable when you have a blended store, as it allows you to compare your sales from your two different sales audiences over the same timeframe in a single report.

In this example, a net sales over a 12-month period is displayed, but you can also choose to display total sales instead of net sales, or segment your timeframe by weeks or days instead of months.

Steps:

Using configuration panel
  1. From your Shopify admin, go to Analytics > Reports.

  2. Click New exploration.

  3. In the configuration panel, select your report data:

    1. In the Metrics menu, click , and then select Net sales.
    2. In the Dimensions menu, click to add the following dimensions in order:
      • Is B2B order
      • Month
    3. In the Filters menu, click the Date range value and set it to be Last 12 months, and then click Apply.
    4. Optional: Add additional metrics, dimensions, a comparison, and filters to display other information that you want. You can also click the Visualization menu to select a different visualization for your data.
  4. After you create your report, click Save.

  5. In the Save report dialog, give your report a name, and then click Save.

Using ShopifyQL
  1. From your Shopify admin, go to Analytics > Reports.

  2. Click New exploration.

  3. Copy the following query and paste it into the ShopifyQL query editor panel:

FROM sales
SHOW net_sales
GROUP BY is_b2b_order, month
TIMESERIES MONTH
WITH TOTALS, GROUP_TOTALS
SINCE startOfMonth(-12m)
UNTIL endOfMonth(-1m)
ORDER BY net_sales__is_b2b_order_totals DESC, month ASC, net_sales DESC, is_b2b_order ASC
LIMIT 1000
VISUALIZE net_sales
  1. Optional: Customize your ShopifyQL query to adjust the data that's included in your report.
  2. Click ▹ Run.
  3. After you create your report, click Save.
  4. In the Save report dialog, give your report a name, and then click Save.

Example: Create a sales report of your top B2B customers and locations

You can create a sales report that displays net sales from your B2B customers in descending order. The report is segmented by company name and company location, so your top-selling companies are listed first, and within each company, the top-selling company locations are listed first. The report also filters out all sales from non-B2B customers.

In this example, a net sales over a 12-month period is displayed, but you can also choose to display total sales instead of net sales, or segment your timeframe by weeks or days instead of months. You might also choose to leave out the Company location name dimension entirely, when displaying a breakdown of sales by company location isn't relevant to you.

Steps:

Using configuration panel
  1. From your Shopify admin, go to Analytics > Reports.

  2. Click New exploration.

  3. In the configuration panel, manually select your report data:

    1. In the Metrics menu, click , and then select Net sales.
    2. In the Dimensions menu, click to add the following dimensions in order:
      • Company name
      • Company location name
    3. In the Filters menu, configure the following settings:
      • Click the Date range value and set it to be Last 12 months, and then click Apply.
      • Click and then select Is B2B order. In that new filter, click Yes.
    4. Optional: Add additional metrics, dimensions, a comparison, and filters to display other information that you want. You can also click the Visualization menu to select a different visualization for your data.
  4. After you create your report, click Save.

  5. In the Save report dialog, give your report a name, and then click Save.

Using ShopifyQL
  1. From your Shopify admin, go to Analytics > Reports.

  2. Click New exploration.

  3. Copy the following query and paste it into the ShopifyQL query editor panel:

FROM sales
SHOW net_sales
WHERE is_b2b_order = true
GROUP BY company_name, company_location_name
WITH TOTALS, GROUP_TOTALS
SINCE startOfMonth(-12m)
UNTIL endOfMonth(-1m)
ORDER BY net_sales__company_name_totals DESC, net_sales DESC, company_name ASC, company_location_name ASC
LIMIT 1000
VISUALIZE net_sales
  1. Optional: Customize your ShopifyQL query to adjust the data that's included in your report.
  2. Click ▹ Run.
  3. After you create your report, click Save.
  4. In the Save report dialog, give your report a name, and then click Save.
Can’t find the answers you’re looking for? We’re here to help.