按尺寸自定义总计

时间:2016-02-25 20:12:46

标签: tableau

我有这样的数据源:

Department   Employee  City  Class Peroid   Qty1 Qty2 Qty3
----------------------------------------------------------
Dept1        John       c1     1     1st    1    2    3
Dept1        John       c1     1     2nd    11   22   33
Dept1        Mary       c2     1     1st    2    3    4
Dept1        Mary       c2     1     2nd    22   33   44
Dept2        Joe        c1     1     1st    3    4    5
Dept2        Joe        c1     1     2nd    33   44   55
Dept2        Paul       c3     1     1st    4    5    6
Dept2        Paul       c3     1     2nd    44   55   66

在工作簿中,我希望按城市显示常规总计和自定义总计:

                                             Class  /  Period
                                                    1
             Department    Employee  City     1st        2nd
             ---------------------------------------------------
             Dept1         John       c1    1  2  3   11  22  33
             Dept1         Mary       c2    2  3  4   22  33  44
             Dept2         Joe        c1    3  4  5   33  44  55
             Dept2         Paul       c3    4  5  6   44  55  66
Grand Total                                10 14 18  110 154 198
Total by City                         c1    4  6  8   55  66  88
                                      c2    2  3  4   22  33  44
                                      c3    4  5  6   44  55  66 

这可能吗?

2 个答案:

答案 0 :(得分:1)

你可以实现这一目标,但不完全如你在模型中所示。

Tableau的总计和小计工作以您预期的不同方式工作。

以下是与您的数据一起创建的工作簿。如果这对您有用,请告诉我。

Link to public workbook .

答案 1 :(得分:0)

是的,它可能在oracle或sql server中提供内置函数。 你可以使用rank()&分区函数来实现这一点。

相关问题