问题描述
我开始与Tableau合作,发现了如何制作瀑布图(甘特图,y轴的滚动总和,条形长度的负值。请参见此处:
如果您真正了解自己在做什么,那会更容易寻找解决方案。例如,甘特图(Gantt Chart)的这种黑客攻击使之成为瀑布。在数据的起点,图表将了解行的内容,而图表的大小则取决于大小。您输入负值会导致您希望该条下降。
话虽这么说,将一个字段拖动为彩色不会弄乱大小,但是会弄乱用于确定起点的运行总和。怎么解决呢?使它一起计算所有颜色。怎么做?了解表计算并找到我的解决方案。
这是一种简单的方法,如果您的数据库或字段具有某些特殊性,则可能无法正常工作,因此您需要解释,以便我可以尝试了解如何解决
I started working with Tableau and found out how to do waterfall charts (Gantt-charts, rolling sum for y-axis and negative value for length of bar. See here: tableau tutorial waterfall charts)
Now my question would be if there is a possibility to split the color by some category? To show what I'm talking about I set up some waterfalls with excel powerpoint. The first one without a split by a category and the second one with a split by category.
I would appreciate any help
It is as simple as dragging the right field to Color, and adjusting the table calculation.
If it's a simple running sum (for the positioning of the bar), you need to go edit the table calculation, select Compute using Advanced..., then drag all fields to addressing. Then you need to sort your data by the master field (in your case the one that has Coffee, Coke,...) maximum (ascending or descending, doesn't matter).
This way you guarantee that the running sum is being applied to one category at a time (at not one color at a time or something like that).
It's really important to understand the concept of table calculations so you can understand what's going on, how Tableau is calculating stuff. Read this http://onlinehelp.tableausoftware.com/current/pro/online/en-us/help.htm#calculations_tablecalculations_understanding_addressing.html
And if you actually understand what you're doing, it's easier to find a solution. For instance, this hack of Gantt Chart to make a waterfall. What goes on rows the chart will understand at starting point of the data, and what goes on size is, well, the size of the chart. You put negative values cause you want the bar to go down.That being said, dragging a field to color won't mess up with the size, but it will mess up with the running sum used to determine the starting points. How to solve it? make it calculate all the colors together. How to make it? Understand table calculations and reach my solution.
This is the simple approach, if your database or fields have some peculiarity, this might not work perfectly, and you'll need to explain so I can try to understand how to solve
这篇关于色彩缤纷的Tableau瀑布图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!