Spaces:
Runtime error
Runtime error
Download data/indicators_metadata.json from Macbath/indicator-modeling: direct link, hf CLI and curl.
- Browser
- Download file 30.3 kB
-
https://huggingface.co/spaces/Macbath/indicator-modeling/resolve/main/data/indicators_metadata.json
- Command line
-
hf download hf://spaces/Macbath/indicator-modeling/data/indicators_metadata.json
-
curl -L -o indicators_metadata.json https://huggingface.co/spaces/Macbath/indicator-modeling/resolve/main/data/indicators_metadata.json
30.3 kB
| [ | |
| { | |
| "id": "retail_001", | |
| "name": "日销售额", | |
| "description": "统计每天的销售总金额,按订单日期聚合", | |
| "category": "销售指标", | |
| "sql_template": "SELECT DATE(order_date) as date, SUM(total_amount) as daily_sales FROM orders WHERE order_date >= '{start_date}' AND order_date <= '{end_date}' GROUP BY DATE(order_date) ORDER BY date", | |
| "dimensions": [ | |
| "order_date", | |
| "store_id" | |
| ], | |
| "metrics": [ | |
| "total_amount" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "retail_002", | |
| "name": "客单价", | |
| "description": "平均每个订单的金额,反映客户消费水平", | |
| "category": "销售指标", | |
| "sql_template": "SELECT AVG(order_amount) as avg_order_value FROM orders WHERE order_date >= '{start_date}'", | |
| "dimensions": [ | |
| "order_date" | |
| ], | |
| "metrics": [ | |
| "order_amount" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "retail_003", | |
| "name": "日均订单量", | |
| "description": "统计平均每天的订单数量", | |
| "category": "销售指标", | |
| "sql_template": "SELECT DATE(order_date) as date, COUNT(DISTINCT order_id) as order_count FROM orders GROUP BY DATE(order_date)", | |
| "dimensions": [ | |
| "order_date" | |
| ], | |
| "metrics": [ | |
| "order_id" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "retail_004", | |
| "name": "库存周转率", | |
| "description": "统计商品的库存周转速度,反映库存管理效率", | |
| "category": "库存指标", | |
| "sql_template": "SELECT product_id, SUM(sold_quantity) / AVG(stock_quantity) as turnover_rate FROM inventory JOIN sales ON inventory.product_id = sales.product_id GROUP BY product_id", | |
| "dimensions": [ | |
| "product_id", | |
| "category" | |
| ], | |
| "metrics": [ | |
| "sold_quantity", | |
| "stock_quantity" | |
| ], | |
| "update_frequency": "每周" | |
| }, | |
| { | |
| "id": "retail_005", | |
| "name": "门店坪效", | |
| "description": "每平米营业面积的销售额,反映门店运营效率", | |
| "category": "运营指标", | |
| "sql_template": "SELECT store_id, SUM(sales_amount) / AVG(floor_area) as sales_per_sqm FROM stores JOIN sales ON stores.store_id = sales.store_id GROUP BY store_id", | |
| "dimensions": [ | |
| "store_id" | |
| ], | |
| "metrics": [ | |
| "sales_amount", | |
| "floor_area" | |
| ], | |
| "update_frequency": "每月" | |
| }, | |
| { | |
| "id": "retail_006", | |
| "name": "会员复购率", | |
| "description": "统计会员在指定时间段内的复购比例", | |
| "category": "客户指标", | |
| "sql_template": "SELECT COUNT(DISTINCT member_id) as repeat_customers FROM (SELECT member_id, COUNT(DISTINCT order_id) as order_count FROM orders GROUP BY member_id HAVING order_count > 1) t", | |
| "dimensions": [ | |
| "member_id", | |
| "order_date" | |
| ], | |
| "metrics": [ | |
| "order_id" | |
| ], | |
| "update_frequency": "每月" | |
| }, | |
| { | |
| "id": "retail_007", | |
| "name": "商品售罄率", | |
| "description": "统计商品在促销期间的售罄比例", | |
| "category": "库存指标", | |
| "sql_template": "SELECT product_id, SUM(sold_quantity) / SUM(initial_stock) as sellout_rate FROM inventory WHERE promotion_flag = 1 GROUP BY product_id", | |
| "dimensions": [ | |
| "product_id", | |
| "promotion_id" | |
| ], | |
| "metrics": [ | |
| "sold_quantity", | |
| "initial_stock" | |
| ], | |
| "update_frequency": "实时" | |
| }, | |
| { | |
| "id": "retail_008", | |
| "name": "促销活动ROI", | |
| "description": "计算促销活动的投资回报率", | |
| "category": "营销指标", | |
| "sql_template": "SELECT promotion_id, (SUM(incremental_sales) - SUM(promotion_cost)) / SUM(promotion_cost) as roi FROM promotions JOIN sales ON promotions.promotion_id = sales.promotion_id GROUP BY promotion_id", | |
| "dimensions": [ | |
| "promotion_id", | |
| "promotion_type" | |
| ], | |
| "metrics": [ | |
| "incremental_sales", | |
| "promotion_cost" | |
| ], | |
| "update_frequency": "活动后" | |
| }, | |
| { | |
| "id": "retail_009", | |
| "name": "退货率", | |
| "description": "统计订单中退货订单的占比", | |
| "category": "服务指标", | |
| "sql_template": "SELECT DATE(order_date) as date, COUNT(DISTINCT CASE WHEN return_flag = 1 THEN order_id END) / COUNT(DISTINCT order_id) as return_rate FROM orders GROUP BY DATE(order_date)", | |
| "dimensions": [ | |
| "order_date", | |
| "store_id" | |
| ], | |
| "metrics": [ | |
| "return_flag", | |
| "order_id" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "retail_010", | |
| "name": "会员活跃度", | |
| "description": "统计近30天有购买行为的会员占比", | |
| "category": "客户指标", | |
| "sql_template": "SELECT COUNT(DISTINCT CASE WHEN DATEDIFF(NOW(), last_purchase_date) <= 30 THEN member_id END) / COUNT(DISTINCT member_id) as active_rate FROM members", | |
| "dimensions": [ | |
| "member_level" | |
| ], | |
| "metrics": [ | |
| "last_purchase_date" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "retail_011", | |
| "name": "连带率", | |
| "description": "平均每个订单包含的商品件数", | |
| "category": "销售指标", | |
| "sql_template": "SELECT AVG(item_count) as avg_items_per_order FROM (SELECT order_id, COUNT(DISTINCT item_id) as item_count FROM order_items GROUP BY order_id) t", | |
| "dimensions": [ | |
| "order_id" | |
| ], | |
| "metrics": [ | |
| "item_id" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "retail_012", | |
| "name": "折扣率", | |
| "description": "统计订单的平均折扣比例", | |
| "category": "销售指标", | |
| "sql_template": "SELECT AVG((original_price - actual_price) / original_price) as discount_rate FROM orders WHERE discount_flag = 1", | |
| "dimensions": [ | |
| "order_date", | |
| "store_id" | |
| ], | |
| "metrics": [ | |
| "original_price", | |
| "actual_price" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "retail_013", | |
| "name": "新品销售占比", | |
| "description": "统计新品销售额占总销售额的比例", | |
| "category": "产品指标", | |
| "sql_template": "SELECT SUM(CASE WHEN DATEDIFF(NOW(), launch_date) <= 30 THEN sales_amount ELSE 0 END) / SUM(sales_amount) as new_product_ratio FROM products JOIN sales ON products.product_id = sales.product_id", | |
| "dimensions": [ | |
| "category" | |
| ], | |
| "metrics": [ | |
| "sales_amount", | |
| "launch_date" | |
| ], | |
| "update_frequency": "每月" | |
| }, | |
| { | |
| "id": "retail_014", | |
| "name": "会员留存率", | |
| "description": "统计新会员在后续月份的留存比例", | |
| "category": "客户指标", | |
| "sql_template": "SELECT MONTH(registration_date) as cohort_month, COUNT(DISTINCT member_id) as retained_count FROM members WHERE DATEDIFF(last_purchase_date, registration_date) >= 30 GROUP BY MONTH(registration_date)", | |
| "dimensions": [ | |
| "registration_date", | |
| "member_level" | |
| ], | |
| "metrics": [ | |
| "last_purchase_date" | |
| ], | |
| "update_frequency": "每月" | |
| }, | |
| { | |
| "id": "retail_015", | |
| "name": "购物车转化率", | |
| "description": "统计加入购物车的商品最终完成购买的比例", | |
| "category": "转化指标", | |
| "sql_template": "SELECT COUNT(DISTINCT CASE WHEN purchase_flag = 1 THEN cart_id END) / COUNT(DISTINCT cart_id) as cart_conversion_rate FROM shopping_cart", | |
| "dimensions": [ | |
| "cart_date" | |
| ], | |
| "metrics": [ | |
| "purchase_flag" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "retail_016", | |
| "name": "门店客流", | |
| "description": "统计每天进店客流数量", | |
| "category": "运营指标", | |
| "sql_template": "SELECT DATE(visit_date) as date, COUNT(DISTINCT visitor_id) as foot_traffic FROM store_visits GROUP BY DATE(visit_date)", | |
| "dimensions": [ | |
| "visit_date", | |
| "store_id" | |
| ], | |
| "metrics": [ | |
| "visitor_id" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "retail_017", | |
| "name": "员工生产率", | |
| "description": "统计每个员工的平均销售额", | |
| "category": "人力资源指标", | |
| "sql_template": "SELECT employee_id, SUM(sales_amount) / COUNT(DISTINCT work_date) as daily_sales_per_emp FROM employees JOIN sales ON employees.employee_id = sales.employee_id GROUP BY employee_id", | |
| "dimensions": [ | |
| "employee_id", | |
| "store_id" | |
| ], | |
| "metrics": [ | |
| "sales_amount", | |
| "work_date" | |
| ], | |
| "update_frequency": "每月" | |
| }, | |
| { | |
| "id": "retail_018", | |
| "name": "供应商交货准时率", | |
| "description": "统计供应商按时交货的订单占比", | |
| "category": "供应链指标", | |
| "sql_template": "SELECT supplier_id, COUNT(DISTINCT CASE WHEN DATEDIFF(actual_delivery_date, promised_date) <= 0 THEN po_id END) / COUNT(DISTINCT po_id) as on_time_rate FROM purchase_orders GROUP BY supplier_id", | |
| "dimensions": [ | |
| "supplier_id" | |
| ], | |
| "metrics": [ | |
| "actual_delivery_date", | |
| "promised_date" | |
| ], | |
| "update_frequency": "每月" | |
| }, | |
| { | |
| "id": "retail_019", | |
| "name": "交叉销售率", | |
| "description": "统计购买某商品的客户同时购买其他商品的比例", | |
| "category": "销售指标", | |
| "sql_template": "SELECT p1.product_id as base_product, COUNT(DISTINCT CASE WHEN p2.product_id IS NOT NULL THEN o1.order_id END) / COUNT(DISTINCT o1.order_id) as cross_sell_rate FROM order_items o1 JOIN order_items o2 ON o1.order_id = o2.order_id AND o1.product_id != o2.product_id GROUP BY p1.product_id", | |
| "dimensions": [ | |
| "base_product_category" | |
| ], | |
| "metrics": [ | |
| "product_id" | |
| ], | |
| "update_frequency": "每周" | |
| }, | |
| { | |
| "id": "retail_020", | |
| "name": "库存龄期分析", | |
| "description": "统计库存中不同龄期商品的占比", | |
| "category": "库存指标", | |
| "sql_template": "SELECT CASE WHEN DATEDIFF(NOW(), stock_date) <= 30 THEN '0-30天' WHEN DATEDIFF(NOW(), stock_date) <= 60 THEN '31-60天' ELSE '60天以上' END as age_group, SUM(stock_quantity) as quantity FROM inventory GROUP BY age_group", | |
| "dimensions": [ | |
| "product_id", | |
| "age_group" | |
| ], | |
| "metrics": [ | |
| "stock_quantity", | |
| "stock_date" | |
| ], | |
| "update_frequency": "每周" | |
| }, | |
| { | |
| "id": "ecommerce_001", | |
| "name": "日均UV", | |
| "description": "统计平均每天独立访客数,反映网站流量规模", | |
| "category": "流量指标", | |
| "sql_template": "SELECT DATE(visit_date) as date, COUNT(DISTINCT visitor_id) as daily_uv FROM web_logs WHERE visit_date >= '{start_date}' GROUP BY DATE(visit_date) ORDER BY date", | |
| "dimensions": [ | |
| "visit_date" | |
| ], | |
| "metrics": [ | |
| "visitor_id" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "ecommerce_002", | |
| "name": "转化率", | |
| "description": "统计访客中完成购买的比例", | |
| "category": "转化指标", | |
| "sql_template": "SELECT COUNT(DISTINCT CASE WHEN purchase_flag = 1 THEN visitor_id END) / COUNT(DISTINCT visitor_id) as conversion_rate FROM web_logs", | |
| "dimensions": [ | |
| "visit_date", | |
| "traffic_source" | |
| ], | |
| "metrics": [ | |
| "purchase_flag" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "ecommerce_003", | |
| "name": "GMV", | |
| "description": "商品交易总额,统计所有订单的总金额", | |
| "category": "销售指标", | |
| "sql_template": "SELECT DATE(order_date) as date, SUM(order_amount) as gmv FROM orders WHERE payment_status = 'paid' GROUP BY DATE(order_date) ORDER BY date", | |
| "dimensions": [ | |
| "order_date", | |
| "category" | |
| ], | |
| "metrics": [ | |
| "order_amount" | |
| ], | |
| "update_frequency": "实时" | |
| }, | |
| { | |
| "id": "ecommerce_004", | |
| "name": "客单价", | |
| "description": "平均每个订单的金额", | |
| "category": "销售指标", | |
| "sql_template": "SELECT AVG(order_amount) as avg_order_value FROM orders WHERE order_date >= '{start_date}' AND payment_status = 'paid'", | |
| "dimensions": [ | |
| "order_date" | |
| ], | |
| "metrics": [ | |
| "order_amount" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "ecommerce_005", | |
| "name": "加购率", | |
| "description": "统计访客中加入购物车的占比", | |
| "category": "转化指标", | |
| "sql_template": "SELECT COUNT(DISTINCT CASE WHEN cart_add_flag = 1 THEN visitor_id END) / COUNT(DISTINCT visitor_id) as add_to_cart_rate FROM web_logs", | |
| "dimensions": [ | |
| "visit_date", | |
| "page_type" | |
| ], | |
| "metrics": [ | |
| "cart_add_flag" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "ecommerce_006", | |
| "name": "复购率", | |
| "description": "统计有两次及以上购买的客户占比", | |
| "category": "客户指标", | |
| "sql_template": "SELECT COUNT(DISTINCT CASE WHEN order_count >= 2 THEN customer_id END) / COUNT(DISTINCT customer_id) as repurchase_rate FROM (SELECT customer_id, COUNT(DISTINCT order_id) as order_count FROM orders GROUP BY customer_id) t", | |
| "dimensions": [ | |
| "customer_id" | |
| ], | |
| "metrics": [ | |
| "order_id" | |
| ], | |
| "update_frequency": "每月" | |
| }, | |
| { | |
| "id": "ecommerce_007", | |
| "name": "页面停留时长", | |
| "description": "统计访客在页面上的平均停留时间", | |
| "category": "行为指标", | |
| "sql_template": "SELECT page_url, AVG(TIMESTAMPDIFF(SECOND, page_enter_time, page_exit_time)) as avg_duration FROM page_views GROUP BY page_url", | |
| "dimensions": [ | |
| "page_url", | |
| "page_type" | |
| ], | |
| "metrics": [ | |
| "page_enter_time", | |
| "page_exit_time" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "ecommerce_008", | |
| "name": "跳出率", | |
| "description": "统计只浏览一个页面就离开的访客占比", | |
| "category": "行为指标", | |
| "sql_template": "SELECT COUNT(DISTINCT CASE WHEN page_view_count = 1 THEN visitor_id END) / COUNT(DISTINCT visitor_id) as bounce_rate FROM (SELECT visitor_id, COUNT(DISTINCT page_url) as page_view_count FROM page_views GROUP BY visitor_id) t", | |
| "dimensions": [ | |
| "visit_date", | |
| "traffic_source" | |
| ], | |
| "metrics": [ | |
| "page_url" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "ecommerce_009", | |
| "name": "退款率", | |
| "description": "统计退款订单占总订单的比例", | |
| "category": "服务指标", | |
| "sql_template": "SELECT COUNT(DISTINCT CASE WHEN refund_flag = 1 THEN order_id END) / COUNT(DISTINCT order_id) as refund_rate FROM orders", | |
| "dimensions": [ | |
| "order_date", | |
| "category" | |
| ], | |
| "metrics": [ | |
| "refund_flag" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "ecommerce_010", | |
| "name": "搜索成功率", | |
| "description": "统计搜索后产生购买的访客占比", | |
| "category": "搜索指标", | |
| "sql_template": "SELECT COUNT(DISTINCT CASE WHEN purchase_flag = 1 THEN visitor_id END) / COUNT(DISTINCT visitor_id) as search_success_rate FROM search_logs JOIN web_logs ON search_logs.visitor_id = web_logs.visitor_id WHERE search_flag = 1", | |
| "dimensions": [ | |
| "search_keyword", | |
| "category" | |
| ], | |
| "metrics": [ | |
| "purchase_flag" | |
| ], | |
| "update_frequency": "每周" | |
| }, | |
| { | |
| "id": "ecommerce_011", | |
| "name": "品类销售占比", | |
| "description": "统计各类目销售额占总销售额的比例", | |
| "category": "销售指标", | |
| "sql_template": "SELECT category, SUM(order_amount) / (SELECT SUM(order_amount) FROM orders) as sales_ratio FROM orders GROUP BY category", | |
| "dimensions": [ | |
| "category" | |
| ], | |
| "metrics": [ | |
| "order_amount" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "ecommerce_012", | |
| "name": "广告ROI", | |
| "description": "计算广告投放的投资回报率", | |
| "category": "营销指标", | |
| "sql_template": "SELECT campaign_id, (SUM(revenue) - SUM(ad_cost)) / SUM(ad_cost) as roi FROM ad_campaigns JOIN orders ON ad_campaigns.campaign_id = orders.campaign_id GROUP BY campaign_id", | |
| "dimensions": [ | |
| "campaign_id", | |
| "campaign_type" | |
| ], | |
| "metrics": [ | |
| "revenue", | |
| "ad_cost" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "ecommerce_013", | |
| "name": "优惠券使用率", | |
| "description": "统计领取优惠券的用户中使用优惠券的比例", | |
| "category": "营销指标", | |
| "sql_template": "SELECT coupon_id, COUNT(DISTINCT CASE WHEN used_flag = 1 THEN user_id END) / COUNT(DISTINCT user_id) as usage_rate FROM coupons GROUP BY coupon_id", | |
| "dimensions": [ | |
| "coupon_id", | |
| "coupon_type" | |
| ], | |
| "metrics": [ | |
| "used_flag" | |
| ], | |
| "update_frequency": "活动后" | |
| }, | |
| { | |
| "id": "ecommerce_014", | |
| "name": "用户生命周期价值", | |
| "description": "预测用户在整个生命周期内的总价值", | |
| "category": "客户指标", | |
| "sql_template": "SELECT customer_id, SUM(order_amount) / DATEDIFF(NOW(), first_purchase_date) as ltv FROM orders JOIN customers ON orders.customer_id = customers.customer_id GROUP BY customer_id", | |
| "dimensions": [ | |
| "customer_id", | |
| "member_level" | |
| ], | |
| "metrics": [ | |
| "order_amount", | |
| "first_purchase_date" | |
| ], | |
| "update_frequency": "每月" | |
| }, | |
| { | |
| "id": "ecommerce_015", | |
| "name": "物流时效", | |
| "description": "统计从下单到收货的平均时长", | |
| "category": "物流指标", | |
| "sql_template": "SELECT AVG(TIMESTAMPDIFF(HOUR, order_time, delivery_time)) as avg_delivery_time FROM orders WHERE delivery_status = 'delivered'", | |
| "dimensions": [ | |
| "warehouse_id", | |
| "shipping_method" | |
| ], | |
| "metrics": [ | |
| "order_time", | |
| "delivery_time" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "ecommerce_016", | |
| "name": "评论情感得分", | |
| "description": "统计商品评论的平均情感评分", | |
| "category": "服务指标", | |
| "sql_template": "SELECT product_id, AVG(sentiment_score) as avg_sentiment FROM reviews WHERE review_date >= '{start_date}' GROUP BY product_id", | |
| "dimensions": [ | |
| "product_id", | |
| "category" | |
| ], | |
| "metrics": [ | |
| "sentiment_score" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "ecommerce_017", | |
| "name": "秒杀活动转化率", | |
| "description": "统计秒杀活动页面的访客转化比例", | |
| "category": "活动指标", | |
| "sql_template": "SELECT activity_id, COUNT(DISTINCT CASE WHEN purchase_flag = 1 THEN visitor_id END) / COUNT(DISTINCT visitor_id) as flash_sale_cr FROM activity_logs WHERE activity_type = 'flash_sale' GROUP BY activity_id", | |
| "dimensions": [ | |
| "activity_id", | |
| "activity_date" | |
| ], | |
| "metrics": [ | |
| "purchase_flag" | |
| ], | |
| "update_frequency": "活动后" | |
| }, | |
| { | |
| "id": "ecommerce_018", | |
| "name": "会员留存漏斗", | |
| "description": "分析会员从注册到复购的各阶段转化", | |
| "category": "客户指标", | |
| "sql_template": "SELECT stage, COUNT(DISTINCT user_id) as user_count FROM (SELECT user_id, 'register' as stage FROM users UNION ALL SELECT user_id, 'first_purchase' FROM orders GROUP BY user_id HAVING MIN(order_date) IS NOT NULL UNION ALL SELECT user_id, 'repurchase' FROM orders GROUP BY user_id HAVING COUNT(DISTINCT order_id) >= 2) t GROUP BY stage", | |
| "dimensions": [ | |
| "stage", | |
| "member_level" | |
| ], | |
| "metrics": [ | |
| "user_id" | |
| ], | |
| "update_frequency": "每月" | |
| }, | |
| { | |
| "id": "ecommerce_019", | |
| "name": "跨品类购买率", | |
| "description": "统计购买商品涉及多个品类的用户占比", | |
| "category": "行为指标", | |
| "sql_template": "SELECT COUNT(DISTINCT CASE WHEN category_count >= 2 THEN customer_id END) / COUNT(DISTINCT customer_id) as cross_category_rate FROM (SELECT customer_id, COUNT(DISTINCT category) as category_count FROM orders GROUP BY customer_id) t", | |
| "dimensions": [ | |
| "customer_id" | |
| ], | |
| "metrics": [ | |
| "category" | |
| ], | |
| "update_frequency": "每月" | |
| }, | |
| { | |
| "id": "ecommerce_020", | |
| "name": "直播带货GMV占比", | |
| "description": "统计直播渠道产生的GMV占总GMV的比例", | |
| "category": "渠道指标", | |
| "sql_template": "SELECT SUM(CASE WHEN channel = 'live_stream' THEN order_amount ELSE 0 END) / SUM(order_amount) as live_gmv_ratio FROM orders WHERE order_date >= '{start_date}'", | |
| "dimensions": [ | |
| "channel", | |
| "live_streamer_id" | |
| ], | |
| "metrics": [ | |
| "order_amount" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "finance_001", | |
| "name": "日均成交额", | |
| "description": "统计每天的交易总金额", | |
| "category": "交易指标", | |
| "sql_template": "SELECT DATE(trade_date) as date, SUM(trade_amount) as daily_volume FROM trades WHERE trade_date >= '{start_date}' GROUP BY DATE(trade_date) ORDER BY date", | |
| "dimensions": [ | |
| "trade_date", | |
| "product_type" | |
| ], | |
| "metrics": [ | |
| "trade_amount" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "finance_002", | |
| "name": "不良贷率", | |
| "description": "统计不良贷款占总贷款的比例", | |
| "category": "风险指标", | |
| "sql_template": "SELECT SUM(CASE WHEN loan_status = 'non_performing' THEN loan_amount ELSE 0 END) / SUM(loan_amount) as npl_ratio FROM loans", | |
| "dimensions": [ | |
| "branch_id", | |
| "loan_type" | |
| ], | |
| "metrics": [ | |
| "loan_amount", | |
| "loan_status" | |
| ], | |
| "update_frequency": "每月" | |
| }, | |
| { | |
| "id": "finance_003", | |
| "name": "净息差", | |
| "description": "统计利息收入与利息支出的差额占总资产的比例", | |
| "category": "盈利指标", | |
| "sql_template": "SELECT (SUM(interest_income) - SUM(interest_expense)) / SUM(total_assets) as net_interest_margin FROM financial_statements WHERE report_date >= '{start_date}'", | |
| "dimensions": [ | |
| "report_date", | |
| "branch_id" | |
| ], | |
| "metrics": [ | |
| "interest_income", | |
| "interest_expense", | |
| "total_assets" | |
| ], | |
| "update_frequency": "每季度" | |
| }, | |
| { | |
| "id": "finance_004", | |
| "name": "资本充足率", | |
| "description": "统计资本总额与风险加权资产的比例", | |
| "category": "监管指标", | |
| "sql_template": "SELECT SUM(capital) / SUM(risk_weighted_assets) as car FROM regulatory_capital WHERE report_date = '{end_date}'", | |
| "dimensions": [ | |
| "report_date", | |
| "institution_id" | |
| ], | |
| "metrics": [ | |
| "capital", | |
| "risk_weighted_assets" | |
| ], | |
| "update_frequency": "每季度" | |
| }, | |
| { | |
| "id": "finance_005", | |
| "name": "客户资产规模", | |
| "description": "统计每个客户的总资产规模", | |
| "category": "客户指标", | |
| "sql_template": "SELECT customer_id, SUM(deposit_amount + investment_amount) as total_assets FROM accounts JOIN investments ON accounts.customer_id = investments.customer_id GROUP BY customer_id", | |
| "dimensions": [ | |
| "customer_id", | |
| "customer_type" | |
| ], | |
| "metrics": [ | |
| "deposit_amount", | |
| "investment_amount" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "finance_006", | |
| "name": "交易成功率", | |
| "description": "统计成功完成的交易占总交易的比例", | |
| "category": "运营指标", | |
| "sql_template": "SELECT COUNT(DISTINCT CASE WHEN transaction_status = 'success' THEN transaction_id END) / COUNT(DISTINCT transaction_id) as success_rate FROM transactions", | |
| "dimensions": [ | |
| "transaction_date", | |
| "channel" | |
| ], | |
| "metrics": [ | |
| "transaction_status" | |
| ], | |
| "update_frequency": "实时" | |
| }, | |
| { | |
| "id": "finance_007", | |
| "name": "逾期率", | |
| "description": "统计逾期贷款占总贷款的比例", | |
| "category": "风险指标", | |
| "sql_template": "SELECT SUM(CASE WHEN DATEDIFF(NOW(), due_date) > 0 AND payment_status != 'paid' THEN loan_amount ELSE 0 END) / SUM(loan_amount) as overdue_rate FROM loans", | |
| "dimensions": [ | |
| "loan_type", | |
| "branch_id" | |
| ], | |
| "metrics": [ | |
| "loan_amount", | |
| "due_date", | |
| "payment_status" | |
| ], | |
| "update_frequency": "每天" | |
| }, | |
| { | |
| "id": "finance_008", | |
| "name": "净资产收益率", | |
| "description": "统计净利润占净资产的比例", | |
| "category": "盈利指标", | |
| "sql_template": "SELECT SUM(net_profit) / SUM(net_assets) as roe FROM financial_statements WHERE report_date >= '{start_date}'", | |
| "dimensions": [ | |
| "report_date", | |
| "business_unit" | |
| ], | |
| "metrics": [ | |
| "net_profit", | |
| "net_assets" | |
| ], | |
| "update_frequency": "每季度" | |
| }, | |
| { | |
| "id": "finance_009", | |
| "name": "成本收入比", | |
| "description": "统计运营成本占营业收入的比例", | |
| "category": "效率指标", | |
| "sql_template": "SELECT SUM(operating_cost) / SUM(operating_income) as cost_income_ratio FROM financial_statements WHERE report_date >= '{start_date}'", | |
| "dimensions": [ | |
| "report_date", | |
| "branch_id" | |
| ], | |
| "metrics": [ | |
| "operating_cost", | |
| "operating_income" | |
| ], | |
| "update_frequency": "每季度" | |
| }, | |
| { | |
| "id": "finance_010", | |
| "name": "客户流失率", | |
| "description": "统计销户或长期无交易的客户占比", | |
| "category": "客户指标", | |
| "sql_template": "SELECT COUNT(DISTINCT CASE WHEN DATEDIFF(NOW(), last_transaction_date) > 180 THEN customer_id END) / COUNT(DISTINCT customer_id) as churn_rate FROM customers", | |
| "dimensions": [ | |
| "customer_type", | |
| "branch_id" | |
| ], | |
| "metrics": [ | |
| "last_transaction_date" | |
| ], | |
| "update_frequency": "每月" | |
| }, | |
| { | |
| "id": "finance_011", | |
| "name": "拨备覆盖率", | |
| "description": "统计贷款损失准备金占不良贷款的比例", | |
| "category": "风险指标", | |
| "sql_template": "SELECT SUM(loan_loss_provision) / SUM(CASE WHEN loan_status = 'non_performing' THEN loan_amount ELSE 0 END) as provision_coverage FROM loans JOIN provisions ON loans.loan_id = provisions.loan_id", | |
| "dimensions": [ | |
| "report_date", | |
| "branch_id" | |
| ], | |
| "metrics": [ | |
| "loan_loss_provision", | |
| "loan_amount", | |
| "loan_status" | |
| ], | |
| "update_frequency": "每季度" | |
| }, | |
| { | |
| "id": "finance_012", | |
| "name": "资产周转率", | |
| "description": "统计营业收入占总资产的比例", | |
| "category": "效率指标", | |
| "sql_template": "SELECT SUM(operating_income) / SUM(total_assets) as asset_turnover FROM financial_statements WHERE report_date >= '{start_date}'", | |
| "dimensions": [ | |
| "report_date", | |
| "business_unit" | |
| ], | |
| "metrics": [ | |
| "operating_income", | |
| "total_assets" | |
| ], | |
| "update_frequency": "每季度" | |
| }, | |
| { | |
| "id": "finance_013", | |
| "name": "杠杆率", | |
| "description": "统计一级资本占表内外资产余额的比例", | |
| "category": "监管指标", | |
| "sql_template": "SELECT SUM(tier1_capital) / SUM(on_balance_sheet_assets + off_balance_sheet_assets) as leverage_ratio FROM regulatory_capital WHERE report_date = '{end_date}'", | |
| "dimensions": [ | |
| "report_date", | |
| "institution_id" | |
| ], | |
| "metrics": [ | |
| "tier1_capital", | |
| "on_balance_sheet_assets", | |
| "off_balance_sheet_assets" | |
| ], | |
| "update_frequency": "每季度" | |
| }, | |
| { | |
| "id": "finance_014", | |
| "name": "净手续费收入", | |
| "description": "统计手续费及佣金净收入", | |
| "category": "盈利指标", | |
| "sql_template": "SELECT SUM(fee_income - fee_expense) as net_fee_income FROM income_statement WHERE report_date >= '{start_date}'", | |
| "dimensions": [ | |
| "report_date", | |
| "product_type" | |
| ], | |
| "metrics": [ | |
| "fee_income", | |
| "fee_expense" | |
| ], | |
| "update_frequency": "每季度" | |
| }, | |
| { | |
| "id": "finance_015", | |
| "name": "流动性覆盖率", | |
| "description": "统计优质流动性资产占未来30天净流出量的比例", | |
| "category": "流动性指标", | |
| "sql_template": "SELECT SUM(high_quality_liquid_assets) / SUM(net_outflow_30d) as lcr FROM liquidity_metrics WHERE report_date = '{end_date}'", | |
| "dimensions": [ | |
| "report_date", | |
| "institution_id" | |
| ], | |
| "metrics": [ | |
| "high_quality_liquid_assets", | |
| "net_outflow_30d" | |
| ], | |
| "update_frequency": "每月" | |
| }, | |
| { | |
| "id": "finance_016", | |
| "name": "交易对手信用风险敞口", | |
| "description": "统计与交易对手的信用风险敞口总额", | |
| "category": "风险指标", | |
| "sql_template": "SELECT counterparty_id, SUM(exposure_amount) as total_exposure FROM counterparty_risk WHERE risk_type = 'credit' GROUP BY counterparty_id", | |
| "dimensions": [ | |
| "counterparty_id", | |
| "risk_type" | |
| ], | |
| "metrics": [ | |
| "exposure_amount" | |
| ], | |
| "update_frequency": "每月" | |
| }, | |
| { | |
| "id": "finance_017", | |
| "name": "净资产增长率", | |
| "description": "统计净资产的同比增长率", | |
| "category": "成长指标", | |
| "sql_template": "SELECT (SUM(CASE WHEN YEAR(report_date) = YEAR(NOW()) THEN net_assets ELSE 0 END) - SUM(CASE WHEN YEAR(report_date) = YEAR(NOW()) - 1 THEN net_assets ELSE 0 END)) / SUM(CASE WHEN YEAR(report_date) = YEAR(NOW()) - 1 THEN net_assets ELSE 0 END) as net_assets_growth FROM financial_statements", | |
| "dimensions": [ | |
| "report_date", | |
| "business_unit" | |
| ], | |
| "metrics": [ | |
| "net_assets" | |
| ], | |
| "update_frequency": "每季度" | |
| }, | |
| { | |
| "id": "finance_018", | |
| "name": "不良贷款拨备率", | |
| "description": "统计不良贷款损失准备金占不良贷款余额的比例", | |
| "category": "风险指标", | |
| "sql_template": "SELECT SUM(provision_amount) / SUM(loan_amount) as npl_provision_ratio FROM loans JOIN provisions ON loans.loan_id = provisions.loan_id WHERE loan_status = 'non_performing'", | |
| "dimensions": [ | |
| "report_date", | |
| "branch_id" | |
| ], | |
| "metrics": [ | |
| "provision_amount", | |
| "loan_amount", | |
| "loan_status" | |
| ], | |
| "update_frequency": "每季度" | |
| }, | |
| { | |
| "id": "finance_019", | |
| "name": "客户满意度得分", | |
| "description": "统计客户调查的平均满意度评分", | |
| "category": "服务指标", | |
| "sql_template": "SELECT AVG(satisfaction_score) as avg_satisfaction FROM customer_surveys WHERE survey_date >= '{start_date}'", | |
| "dimensions": [ | |
| "survey_date", | |
| "channel" | |
| ], | |
| "metrics": [ | |
| "satisfaction_score" | |
| ], | |
| "update_frequency": "每月" | |
| }, | |
| { | |
| "id": "finance_020", | |
| "name": "资金成本率", | |
| "description": "统计利息支出占平均资金余额的比例", | |
| "category": "成本指标", | |
| "sql_template": "SELECT SUM(interest_expense) / AVG(funding_balance) as cost_of_funds FROM funding_costs WHERE report_date >= '{start_date}'", | |
| "dimensions": [ | |
| "report_date", | |
| "funding_source" | |
| ], | |
| "metrics": [ | |
| "interest_expense", | |
| "funding_balance" | |
| ], | |
| "update_frequency": "每月" | |
| } | |
| ] |