所以我有3个数据集,结构如下:
+-----------+--------+--------+
| Last_Name | Salary | Tenure |
+-----------+--------+--------+
| Hoinski | 40000 | 2 |
| Smith | 90000 | 4 |
| Jones | 120000 | 10 |
+-----------+--------+--------+
+-----------+---------+-------+
| Last_Name | Status | Count |
+-----------+---------+-------+
| Jones | On Time | 4 |
| Jones | Late | 0 |
| Jones | Missing | 1 |
| Hoinski | On Time | 1 |
| Hoinski | Late | 2 |
| Hoinski | Missing | 1 |
+-----------+---------+-------+
+-----------+---------+-------+
| Last_Name | Risk | Count |
+-----------+---------+-------+
| Jones | High | 2 |
| Jones | Low | 1 |
| Jones | Medium | 4 |
| Smith | High | 0 |
| Smith | Low | 1 |
| Smith | Medium | 3 |
| Hoinski | High | 2 |
| Hoinski | Low | 1 |
| Hoinski | Medium | 0 |
+-----------+---------+-------+
我想要状态和风险的2个饼图,以及1个薪水/任期的散点图。当我点击Salary / Tenure的散点图时,我希望饼图从总数切换到我的选择过滤。我让这个工作。
问题是当我点击饼图总数时,让我们说" status = On Time"其他饼图不会过滤。在这个例子中,只有Jones和Hoinski有时间"状态,所以风险的另一个饼图应该删除史密斯,但它没有。
答案 0 :(得分:4)
我怀疑你只是将这三张桌子连在一起。这就是你最终得到的结果(我只会展示琼斯):
cmd /V:ON /E:ON /C "(my_commandline)"
问题在于您正在处理已经聚合的Tableau数据,而不是原始的,未经过编辑的数据。这使得表格很难直观地加入,这使得Tableau在聚合和过滤数据方面的工作非常具有挑战性。您可以看到加入这些表会导致大量重复。
重复是状态饼图中奇数计数的来源:
+-----------+--------+--------+---------+--------+---------+--------+
| Last_Name | Salary | Tenure | Status | CountS | Risk | CountR |
+-----------+--------+--------+---------+--------+---------+--------+
| Jones | 120000 | 10 | On Time | 4 | High | 2 |
| Jones | 120000 | 10 | Late | 0 | High | 2 |
| Jones | 120000 | 10 | Missing | 1 | High | 2 |
| Jones | 120000 | 10 | On Time | 4 | Low | 1 |
| Jones | 120000 | 10 | Late | 0 | Low | 1 |
| Jones | 120000 | 10 | Missing | 1 | Low | 1 |
| Jones | 120000 | 10 | On Time | 4 | Medium | 4 |
| Jones | 120000 | 10 | Late | 0 | Medium | 4 |
| Jones | 120000 | 10 | Missing | 1 | Medium | 4 |
+-----------+--------+--------+---------+--------+---------+--------+
收率:
SELECT Status,
SUM(CountS)
FROM [The joined tables]
WHERE last_name = 'Jones' -- Filtering by Jones
GROUP BY Status;
所有原始数字都乘以3,因为每行重复两次。
此外,让我们按'开启时间'过滤(点击饼图),看看我们的风险饼图会发生什么:
+---------+--------+
| Status | CountS |
+---------+--------+
| On Time | 12 |
| Late | 0 |
| Missing | 3 |
+---------+--------+
收率:
SELECT Risk,
SUM(CountR)
FROM [The joined tables]
WHERE last_name = 'Jones' -- Filtering by Jones
AND Status = 'On Time' -- Filtering by On Time, by clicking the pie slice
GROUP BY Risk;
这种重复使我们再次陷入困境。
如果你可能得到这个数据的原始的,未经过编辑的版本,Tableau会更好地处理这个问题,你将能够用它做更多的事情。否则,您将不得不对如何设置过滤器和聚合进行创造性(并且坦率地说是愚蠢的),并且您会发现整个仪表板最终会成为一个又一个难看的黑客。哥们,哥们。