We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a1ba6cb commit 8716037Copy full SHA for 8716037
models/_sales.yml
@@ -138,6 +138,7 @@ models:
138
- name: referral_source
139
- name: cook_id
140
- name: location_id
141
+ - name: order_value_bucket
142
meta:
143
hashboard:
144
alias: orders
models/orders.sql
@@ -1,11 +1,16 @@
1
-select
+select
2
timestamp,
3
order_id as id,
4
payment_method,
5
delivery,
6
type,
7
customer_id,
8
sum(item_price) as total_order_value,
9
+ case
10
+ when item_price > 10 then 'high'
11
+ when item_price > 5 then 'medium'
12
+ else 'low'
13
+ end as order_value_bucket,
14
any_value(loyalty_status) as loyalty_status,
15
any_value(discount_code) as discount_code,
16
any_value(feedback_rating) as feedback_rating,
0 commit comments