{
  "synthetic": true,
  "ok": true,
  "operation": "consolidate",
  "template": {
    "columns": [
      {
        "name": "customer",
        "kind": "dimension",
        "dimension": "customer"
      },
      {
        "name": "Revenue",
        "kind": "metric",
        "metric": "revenue"
      },
      {
        "name": "Gross profit",
        "kind": "metric",
        "metric": "grossProfit"
      },
      {
        "name": "Gross margin",
        "kind": "metric",
        "metric": "grossMargin"
      },
      {
        "name": "Net profit",
        "kind": "metric",
        "metric": "netProfit"
      }
    ],
    "derivedFrom": "template.columns",
    "grain": [
      "Customer"
    ]
  },
  "columns": [
    "customer",
    "Revenue",
    "Gross profit",
    "Gross margin",
    "Net profit"
  ],
  "period": {
    "requested": ""
  },
  "rowCount": 2,
  "rows": [
    {
      "customer": "DEMO-B",
      "Revenue": 9000,
      "Gross profit": 900,
      "Gross margin": 0.1,
      "Net profit": null
    },
    {
      "customer": "DEMO-A",
      "Revenue": 1000,
      "Gross profit": 500,
      "Gross margin": 0.5,
      "Net profit": null
    }
  ],
  "truncated": false,
  "allRows": [
    {
      "customer": "DEMO-B",
      "Revenue": 9000,
      "Gross profit": 900,
      "Gross margin": 0.1,
      "Net profit": null
    },
    {
      "customer": "DEMO-A",
      "Revenue": 1000,
      "Gross profit": 500,
      "Gross margin": 0.5,
      "Net profit": null
    }
  ],
  "provenance": [
    {
      "Revenue": {
        "basis": "sum",
        "source": "Source A",
        "column": "revenue",
        "rows": 1
      },
      "Gross profit": {
        "basis": "sum",
        "source": "Source A",
        "column": "gross_profit",
        "rows": 1
      },
      "Gross margin": {
        "basis": "recomputed",
        "numerator": "grossProfit",
        "denominator": "revenue"
      },
      "Net profit": {
        "basis": "sum",
        "source": "",
        "column": "",
        "rows": 0
      }
    },
    {
      "Revenue": {
        "basis": "sum",
        "source": "Source A",
        "column": "revenue",
        "rows": 1
      },
      "Gross profit": {
        "basis": "sum",
        "source": "Source A",
        "column": "gross_profit",
        "rows": 1
      },
      "Gross margin": {
        "basis": "recomputed",
        "numerator": "grossProfit",
        "denominator": "revenue"
      },
      "Net profit": {
        "basis": "sum",
        "source": "",
        "column": "",
        "rows": 0
      }
    }
  ],
  "totalRow": {
    "customer": "合计",
    "Revenue": 10000,
    "Gross profit": 1400,
    "Gross margin": 0.14,
    "Net profit": null
  },
  "sourceCoverage": [
    {
      "source": "Source A",
      "role": "",
      "inputRows": 3,
      "usedRows": 2,
      "excludedSubtotals": 1,
      "excludedByRowFilter": 0,
      "periodMatchedRows": 0,
      "availablePeriods": [],
      "contributedMetrics": [
        "Revenue",
        "Gross profit"
      ]
    },
    {
      "source": "Source B",
      "role": "",
      "inputRows": 1,
      "usedRows": 1,
      "excludedSubtotals": 0,
      "excludedByRowFilter": 0,
      "periodMatchedRows": 0,
      "availablePeriods": [],
      "contributedMetrics": [
        "Gross profit"
      ]
    }
  ],
  "conflicts": [
    {
      "cell": "DEMO-A",
      "metric": "grossProfit",
      "metricLabel": "Gross profit",
      "adopted": {
        "source": "Source A",
        "value": 500
      },
      "others": [
        {
          "source": "Source B",
          "value": 600,
          "diff": 100
        }
      ],
      "note": "同一格被多张源表覆盖且数值不一致；已按源表优先级取用第一张，差异未抹平，请复核口径。"
    }
  ],
  "alignmentWarnings": [],
  "unmappedTemplateColumns": [],
  "missingMetrics": [
    {
      "metric": "netProfit",
      "label": "Net profit",
      "note": "A\\B\\C 源表里没有任何列命中该模版指标，输出留空——请补源表或核对 fieldMap，不要填估算值。"
    }
  ],
  "note": "存在同格多源数值冲突，已按源优先级取值并列出差异，未抹平——请按 conflicts 复核后再定稿。",
  "profileStamp": {
    "tenant": "public-demo",
    "version": "public-demo-1"
  }
}
