These examples show how to combine measures, dimensions, segments, and filters to answer complex business questions for restaurant operations.
Note
These examples use views (Sales, ItemSales) which are the recommended way to query the Reporting API. Views pre-join data from multiple cubes and pre-filter for common use cases. For the most up-to-date field names, check the Schema Explorer or the /v1/meta endpoint.
Business Question: "How are my locations performing day by day?"
{ "measures": [ "Sales.net_sales", "Sales.order_count", "Sales.avg_net_sales" ], "dimensions": ["Sales.location_name"], "timeDimensions": [{ "dimension": "Sales.local_reporting_timestamp", "dateRange": "last 30 days", "granularity": "day" }] }
What this returns: Daily net sales, order count, and average order value for each location over the last 30 days. Notice there's no segments needed — the Sales view automatically filters to closed orders, and gives you location_name directly instead of a raw ID.
Business Question: "How do my online sales compare to in-store?"
Online sales:
{ "measures": [ "Sales.net_sales", "Sales.order_count", "Sales.tips_amount" ], "dimensions": ["Sales.channel_name"], "timeDimensions": [{ "dimension": "Sales.local_reporting_timestamp", "dateRange": "this month", "granularity": "day" }], "segments": ["Sales.online"] }
In-store sales:
{ "measures": [ "Sales.net_sales", "Sales.order_count", "Sales.tips_amount" ], "dimensions": ["Sales.channel_name"], "timeDimensions": [{ "dimension": "Sales.local_reporting_timestamp", "dateRange": "this month", "granularity": "day" }], "segments": ["Sales.in_store"] }
What this returns: Daily sales by channel for the current month. Use the Sales.online or Sales.in_store segments to filter by sales channel type, or omit the segment and group by Sales.channel_name to see all channels.
Business Question: "What are my best-selling items by revenue?"
{ "measures": [ "ItemSales.item_net_sales", "ItemSales.items_sold_count" ], "dimensions": [ "ItemSales.item_name", "ItemSales.category_name" ], "timeDimensions": [{ "dimension": "ItemSales.transacted_at", "dateRange": "last 30 days" }], "segments": ["ItemSales.sales"], "order": { "ItemSales.item_net_sales": "desc" }, "limit": 20 }
What this returns: Top 20 items ranked by net sales, with category and quantity for context. The ItemSales view pre-joins item data with order and location information. Use the ItemSales.sales segment to exclude returns.
Business Question: "How much was refunded last month, and which locations had the most refunds?"
{ "measures": [ "Sales.refunds_by_amount_amount", "Sales.net_sales", "Sales.order_count" ], "dimensions": ["Sales.location_name"], "timeDimensions": [{ "dimension": "Sales.local_reporting_timestamp", "dateRange": "last month" }], "filters": [{ "member": "Sales.refunds_by_amount_amount", "operator": "gt", "values": ["0"] }], "order": { "Sales.refunds_by_amount_amount": "desc" } }
What this returns: Refund totals by location name for orders that had refunds, sorted by highest refund amount. Compare against net sales to understand refund rates per location.
Business Question: "Which team members are collecting the most in sales and tips?"
{ "measures": [ "Sales.net_sales", "Sales.order_count", "Sales.tips_amount" ], "dimensions": ["Sales.employee_full_name"], "timeDimensions": [{ "dimension": "Sales.local_reporting_timestamp", "dateRange": "this month" }], "segments": ["Sales.has_tip"], "order": { "Sales.net_sales": "desc" } }
What this returns: Sales and tip totals by team member name for the current month, filtered to orders with tips. The Sales view gives you employee_full_name directly — no need to look up team member IDs.
| Pattern | Use Case | Components Used |
|---|---|---|
| Location comparison | Compare performance across locations | Sales view + location_name dimension |
| Channel analysis | Online vs in-store | Sales view + Sales.online / Sales.in_store segments |
| Item-level analysis | Track menu item performance | ItemSales view + item_name dimension + sales segment |
| Refund filtering | Find orders with refunds | Sales view + filter on refunds_by_amount_amount > 0 |
| Team performance | Identify top performers | Sales view + employee_full_name dimension + has_tip segment |
- Start with a view — Use
Salesfor order-level reporting,ItemSalesfor item-level analysis - Add time dimensions — Always scope to a specific date range
- Layer in dimensions — Add location, channel, or team member dimensions for grouping
- Apply filters — Use filters for thresholds or exclusions
- Use view segments —
Sales.online,Sales.in_store,Sales.has_tip,ItemSales.sales, etc. - Set reasonable limits — Especially important with multiple dimensions
- Order meaningfully — Sort by the metric that matters most for your analysis
- Use the right view —
Salesfor orders,ItemSalesfor items,ModifierSalesfor modifiers
{ "measures": [ "Sales.top_line_product_sales", "Sales.discounts_amount", "Sales.itemized_returns", "Sales.net_sales", "Sales.sales_tax_amount", "Sales.tips_amount", "Sales.total_collected_amount" ], "timeDimensions": [{ "dimension": "Sales.local_reporting_timestamp", "dateRange": "last 30 days", "granularity": "day" }] }
{ "measures": ["Sales.net_sales", "Sales.order_count"], "dimensions": ["Sales.location_name"], "timeDimensions": [{ "dimension": "Sales.local_reporting_timestamp", "dateRange": "this month" }], "order": {"Sales.net_sales": "desc"} }