From 4e218dd1627f0f12f7d9d8514ca9555267a71a7d Mon Sep 17 00:00:00 2001 From: tikkhun Date: Fri, 23 Jan 2026 14:56:25 +0800 Subject: [PATCH] =?UTF-8?q?feat(cube):=20=E5=9C=A8=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E4=B8=AD=E6=B7=BB=E5=8A=A0=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加订单的首次和最后创建时间统计字段,用于分析客户订单时间分布 --- container/cube/conf/model/cubes/order.yml | 7 ++++++- container/cube/query/customer_order_price_sum.json | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/container/cube/conf/model/cubes/order.yml b/container/cube/conf/model/cubes/order.yml index 1ec175d..3e91941 100644 --- a/container/cube/conf/model/cubes/order.yml +++ b/container/cube/conf/model/cubes/order.yml @@ -153,7 +153,12 @@ cubes: - name: total sql: total type: sum - + - name: last_created_at + sql: date_created + type: max + - name: first_created_at + sql: date_created + type: min pre_aggregations: # Pre-aggregation definitions go here. # Learn more in the documentation: https://cube.dev/docs/caching/pre-aggregations/getting-started diff --git a/container/cube/query/customer_order_price_sum.json b/container/cube/query/customer_order_price_sum.json index de03b13..6ea8b5c 100644 --- a/container/cube/query/customer_order_price_sum.json +++ b/container/cube/query/customer_order_price_sum.json @@ -1,7 +1,8 @@ { "measures": [ "order.total", - "order.count" + "order.count", + "order.last_created_at" ], "dimensions": [ "order.customer_email"