Spotfire,计算列以显示百分比

时间:2016-09-13 08:50:19

标签: percentage calculated-columns spotfire

我希望你很好,你可以得到帮助。我有一张桌子,我需要计算列,以显示“没有”的百分比。 '是'和'空'我有。我在下面附上了一张照片。 enter image description here

非常感谢任何语法帮助。

enter image description here

菲利普康奈尔发布的错误截图:

enter image description here

2 个答案:

答案 0 :(得分:2)

@Philip Connell - 我使用下面的表达式创建了一个计算列'consent%',并将此列的格式更改为列属性的百分比。

[number] / [Total amount]

在交叉表中使用此计算列。截图如下。 如果这是您正在寻找的解决方案,请告诉我。 enter image description here

精炼解决方案:

为了便于解释,我创建了一些示例数据。

enter image description here

在将示例数据加载到Spotfire时添加了数据转换(客户ID计数)。

enter image description here

创建了两个计算列。

总金额:

  

总和([Customer_ID的计数])超过([国家])

同意%:

  

[客户ID数] / [总金额]

enter image description here

答案 1 :(得分:0)

解决方案如下

Count([CUSTOMER_ID]) as [No. Of Customers], Count([CUSTOMER_ID]) THEN [Value] / Sum([Value]) OVER (All([Axis.Columns])) as [Percentage ]

谢谢大家的支持

相关问题