跳到主要内容

交叉表按年月交叉

概述

交叉表按年月交叉:根据年份与月份对数据进行交叉统计。

应用场景

如下图所示,简单展示数据

image
Preview

示例说明

数据准备

在数据面板中添加数据集,可选择Json数据集和API服务数据集。Json数据集输入如下图所示:

[
{"TheYear":1996,"TheMonth":7,"Amount":30192.1},
{"TheYear":1996,"TheMonth":8,"Amount":26609.4},
{"TheYear":1996,"TheMonth":9,"Amount":27636},
{"TheYear":1996,"TheMonth":10,"Amount":41203.6},
{"TheYear":1996,"TheMonth":11,"Amount":49704},
{"TheYear":1996,"TheMonth":12,"Amount":50953.4},
{"TheYear":1997,"TheMonth":1,"Amount":66692.8},
{"TheYear":1997,"TheMonth":2,"Amount":41207.2},
{"TheYear":1997,"TheMonth":3,"Amount":39979.9},
{"TheYear":1997,"TheMonth":4,"Amount":55699.39},
{"TheYear":1997,"TheMonth":5,"Amount":56823.7},
{"TheYear":1997,"TheMonth":6,"Amount":39088},
{"TheYear":1997,"TheMonth":7,"Amount":55464.93},
{"TheYear":1997,"TheMonth":8,"Amount":49981.69},
{"TheYear":1997,"TheMonth":9,"Amount":59733.02},
{"TheYear":1997,"TheMonth":10,"Amount":70328.5},
{"TheYear":1997,"TheMonth":11,"Amount":45913.36},
{"TheYear":1997,"TheMonth":12,"Amount":77476.26},
{"TheYear":1998,"TheMonth":1,"Amount":100858.72},
{"TheYear":1998,"TheMonth":2,"Amount":104561.95},
{"TheYear":1998,"TheMonth":3,"Amount":109872.95},
{"TheYear":1998,"TheMonth":4,"Amount":134630.56},
{"TheYear":1998,"TheMonth":5,"Amount":19898.66}
]

报表设计

将数据字段拖入A2、B1、B2单元格,并设置为分组。
将A2设置为向下扩展,B1设置为向右扩展,B2设置为双向扩展。
选中A1-B2,点击上方工具栏-添加分组。

如下图所示

image
Preview

效果预览

交叉表按年月交叉.json

image
Preview