0 / 0
Go back to the English version of the documentation
Decision Optimization 实验中的透视表窗口小部件
Last updated: 2024年10月07日
Decision Optimization 实验中的透视表窗口小部件

您可以在 可视化 视图 中添加透视表,以显示以不同方式聚集的现有 (输入或输出) 表中的数据。

要显示聚集的数据,请选择要显示的表列和行,然后选择相应的聚集器以计算每个单元格的数据。

例如,为透视表生成的 JSON 代码如下所示:
{
  "name": "",
  "type": "Pivot",
  "props": {
    "container": "Pivot2",
    "data": "party",
    "spec": {
      "config": {},
      "columns": [
        {
          "property": "Party Size",
          "label": "Party Size",
          "type": "Number",
          "visible": true,
          "width": 0,
          "style": {}
        }
      ],
      "rows": [
        {
          "property": "Payer Gender",
          "label": "Payer Gender",
          "type": "String",
          "visible": true,
          "width": 0,
          "style": {}
        },
        {
          "property": "Day of Week",
          "label": "Day of Week",
          "type": "String",
          "visible": true,
          "width": 0,
          "style": {}
        }
      ],
      "tableRenderer": "Table Row Heatmap",
      "aggregator": "Count Unique Values",
      "aggregatedCol1": "Tip"
    },
    "search": ""
  }
}
表 1. 透视表窗口小部件规范
字段 描述
name 窗口小部件的名称
type 透视
container 所选方案
data 要透视的现有表的名称
columns 用作透视列标题的现有表的列数组
rows 现有表中用作透视行标题的行的数组
tableRenderer 所呈现的表的类型。 从以下选项中选择 TableTable HeatmapTable Col HeatmapTable Row Heatmap
aggregator 用于从所选列和行计算单元格的函数。 提供了多个选项:CountCount Unique ValuesList Unique ValueSumInteger SumAverageMedianSample varianceSample Standard DeviationMinimumMaximumFirstLastSum over SumSum as Fraction of TotalSum as Fraction of RowsSum as Fraction of ColumnsCount as Fraction of TotalCount as Fraction of RowsCount as Fraction of Columns

aggregatedCol1

aggregatedCol2

那些需要表列来聚集数据的聚集器所需的列的名称。Count 聚集器不需要此类列名。 Sum over Sum 聚集器需要 2 列,而所有其他聚集器需要一列。
Generative AI search and answer
These answers are generated by a large language model in watsonx.ai based on content from the product documentation. Learn more