← 返回主平台

常见任务

  • 统一对账数据格式
  • 计算成本、收入、利润等衍生指标
  • 按部门、产品、地区聚合财务数据
  • 生成周报、月报、年报

完整处理流程

1. 数据清洗和规范化

[
  { "type": "normalize", "field": "date", "mode": "date" },
  { "type": "normalize", "field": "revenue", "mode": "number" },
  { "type": "normalize", "field": "cost", "mode": "number" },
  { "type": "fillMissing", "field": "category", "strategy": "default", "defaultValue": "Other" }
]

2. 计算财务指标

[
  { "type": "compute", "targetField": "gross_profit", "formula": "revenue - cost" },
  { "type": "compute", "targetField": "profit_margin", "formula": "IF(revenue==0, 0, gross_profit/revenue*100)" },
  { "type": "compute", "targetField": "report_month", "formula": "DATE_FORMAT(date, 'YYYY-MM')" }
]

3. 按维度聚合

{
  "type": "aggregate",
  "groupBy": ["report_month", "category"],
  "targets": [
    { "field": "revenue", "agg": "sum", "outputField": "total_revenue" },
    { "field": "cost", "agg": "sum", "outputField": "total_cost" },
    { "field": "gross_profit", "agg": "sum", "outputField": "total_profit" },
    { "field": "profit_margin", "agg": "avg", "outputField": "avg_margin" }
  ]
}

关键度量

指标 计算公式
毛利 revenue - cost
毛利率 (revenue - cost) / revenue * 100%
单位成本 cost / quantity
人均产出 revenue / headcount
💡 相关指南: 计算规则 | 聚合规则