(文档仅供参考)
问题描述:
透视分析报表里面勾选了多个维度和度量展示,希望最终展示多个维度下的某个度量排序前十行结果即可,例如勾选了发货区域、产品名称和产品类别三个维度,和其他几个度量,希望是按照三个维度分组展示后,按照运费降序取前十行展示即可,如何实现呢?
解决方案:
(1)通过topcount和NonEmptyCrossjoin函数新建命名集处理即可:
(2)新建命名集时,NonEmptyCrossjoin函数放两参数的,因此涉及多个维度的都依次嵌套多层使用,注意:维度都是拖拽表维度字段下面的成员维使用:
topcount(NonEmptyCrossjoin(维度1.members,NonEmptyCrossjoin(维度2.members,NonEmptyCrossjoin(维度3.members,维度4.members))),
10,
度量字段)
(3)若实际叉乘有null的话,得判断去空处理,并且涉及的维度都是拖拽表维度字段下面的成员维使用:
topcount(filter(NonEmptyCrossjoin(维度1.members,NonEmptyCrossjoin(维度2.members,NonEmptyCrossjoin(维度3.members,维度4.members))),
维度1.currentmember.caption<> '#null'
and 维度2.currentmember.caption<> '#null'
and 维度3.currentmember.caption<> '#null'
and 维度4.currentmember.caption<> '#null'),
10,
度量字段)
(4)建好命名集以后改为拖拽命名集作为维度即可,效果如图: