Loading problem...
Your analytics warehouse stores order volume in compressed form.
Table: orders
Instead of storing every order row, one row summarizes many identical orders.
Task: Compute the average number of items per order across the full dataset.
Metric definition:
Output rules:
Supported submission environments:
orders:
| order_id | item_count | order_occurrences |
|----------|------------|-------------------|
| 10 | 1 | 500 |
| 11 | 2 | 1000 |
| 12 | 3 | 800 |
| 13 | 4 | 1000 |[
{"average_items_per_order":2.7}
]Weighted items = 1500 + 21000 + 3800 + 41000 = 8900. Total orders = 3300. Mean = 8900/3300 = 2.696..., rounded to 2.70.
orders:
| order_id | item_count | order_occurrences |
|----------|------------|-------------------|
| 20 | 2 | 250 |
| 21 | 1 | 750 |[
{"average_items_per_order":1.25}
]Weighted items = 2250 + 1750 = 1250, total orders = 1000, so the compressed mean is 1.25.
orders:
| order_id | item_count | order_occurrences |
|----------|------------|-------------------|
| 30 | 5 | 0 |
| 31 | 2 | 0 |
| 32 | 9 | 0 |[
{"average_items_per_order":0.0}
]No effective orders exist because all occurrences are zero, so the denominator is 0 and the result must be 0.00.
Constraints