Spotfire - Show top values in stacked bar chart

一笑奈何 提交于 2020-06-01 05:52:02

问题


I have a stacked bar chart that looks like this :

I would like to only show the top 3 bars in terms of value, that is to say the three first bars. I tried to use the Show/Hide feature but it doesn't work as I expected.

For example if I limit to Show top 1 value with the Show/Hide value, i get :

when I expect to also have the orange and blue bars that are stacked in the first picture.

Is there a way to do what I am looking for?


回答1:


You will have to achieve a dynamic rank and use that to filter out the top 3. Put this rank logic in the hide/show. It's not clearly given here but in ur dataset you can rank by column on x axis and say rank always less than 3.




回答2:


I found a better way to do this :

Using the Show/Hide rules of the properties of the visualization, you have to add this rule

DenseRank(Sum([Value]) over (All([Axis.Color])),"desc") <= 3

Then you have to [Axis.Value] in the value input.


3 is the number of bars to have in the bar chart.

[Value] is the column of the Y Axis, in my case I used Count() because my Y axis is (Row Count).


You can find more info at this link : https://community.tibco.com/questions/question-showhide-top-10



来源:https://stackoverflow.com/questions/51439011/spotfire-show-top-values-in-stacked-bar-chart

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