简体   繁体   English

Spotfire 交叉表计算

[英]Spotfire Cross Table Calculation

I have a table that I am trying to perform a series of calculations on while allowing the underlying data to be filtered to update the values.我有一个表,我正在尝试对其执行一系列计算,同时允许过滤基础数据以更新值。

Here are some sample values:以下是一些示例值:

Contract    Approver    Analyst
1   Matt    John
2   Matt    John
3   Matt    John
4   Matt    John
5   Matt    John
6   Matt    John
7   Matt    John
8   Matt    Robert
9   Matt    Kim
10  Matt    Jack
11  Matt    Sue
12  Matt    Regina
13  Matt    Robert
14  Matt    Robert
15  Matt    Robert
16  Matt    Robert
17  Matt    Robert
18  Matt    Robert
19  Matt    Robert
20  Matt    Robert
21  Matt    Robert
22  Matt    Jack
23  Matt    Sue
24  Matt    Regina
25  Matt    John
26  Matt    Robert
27  Matt    Kim

I want my resulting table to have the following columns:我希望我的结果表具有以下列:

    Approver_AnalystIdentifier  CountApprover_Analyst  CountApproverTotal    Percentage(Countapprover_analyst/CountApproverTotal)
    MattJack    2        26       7%
    MattJohn    8        26       7%
    MattKim     1        26       7%
    MattRegina  2        26       7%
    MattRobert  11        26       7%
    MattSue     2       26       7%

How can I do this in spotfire, what visualization should I use and are there any custom expressions I would have to input?我怎样才能在 Spotfire 中做到这一点,我应该使用什么可视化,我是否需要输入任何自定义表达式?

Thanks!谢谢!

You can pivot your data.您可以旋转您的数据。 Using your example, something like this image.使用您的示例,类似于此图像。 You'll end up with a data table with 3 columns, Approver, Analyst, count(contract).您最终会得到一个包含 3 列的数据表,批准者、分析师、计数(合同)。 To get your the percentage insert calculated column or custom expression with the formula: [Count(Contract)] / Sum([Count(Contract)]) .要使用以下公式获取百分比插入计算列或自定义表达式: [Count(Contract)] / Sum([Count(Contract)]) format as a percentage.格式为百分比。 The Countapprover total you want is just sum([count(contract)]. If you have more than 1 approver, you will need to use an OVER statement. sum([Count(contract)] OVER ([Approver].您想要的 Countapprover 总数只是 sum([count(contract)]。如果您有 1 个以上的审批人,则需要使用 OVER 语句。 sum([Count(contract)] OVER ([Approver].

在此处输入图片说明

you can use a summary table to do what you want.您可以使用汇总表来做您想做的事情。 You can add columns with aggregations and select many columns to be displayed by default on the table.您可以添加带有聚合的列并选择要在表上默认显示的许多列。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM