It is possible to sort by “valid” percentage in my data?

隐身守侯 提交于 2019-12-25 08:57:07

问题


Using Tableau, I have arranged some data in a 100.00% stacked bar:

I want to sort the data descending (largest to smallest) by Valid component type (green) - is this possbile?

UPDATE (26th July 2017)

merawalaid's answer ALMOST worked; I followed the steps, adjusted the code to match my specific project, and it resulted in this:

As you can see, it is somewhat sorted, but not quite as it should be (for example, the fourth and sixth rows are featured too high in the chart.

Is there something that might be wrong that I have missed here?


回答1:


I was able to do this: You can download my workbook here. Be advised though, I feel there would probably be a simpler way out there to do this.

What I did was to create 2 calculated fields.

'ValidComponentCount': IF ([Component Type]='Valid Component') THEN 1 ELSE 0 END

'% of Valid': {FIXED [Rootname] : SUM([validCount])/COUNT([Number of Records])}

Then sorted the 'Rootname' column based on descending value of the 2nd calculated field (% of Valid).



来源:https://stackoverflow.com/questions/45306339/it-is-possible-to-sort-by-valid-percentage-in-my-data

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!