Jump to content

Question on Show/Hide Top 10


Adam Wilson 2

Recommended Posts

I have a bar chart(first image attachedbelow) that displays the capacity installed (x-axis) by manufacturer (y-axis) with individual country capacity colored in each bar. I want to show the same chart with individual country capacities in the bars but only the top 10 manufacturers to make it more readable. However when I apply a show/hide feature for the top 10, it only displays the top individual capacities in a given country (second image attached). Basically it takes the top 10 numbers in the value column of the referenced data (snapshot of the data also attached). I want to show the top manufacturers by total global capacity with each bar colored to show individual capacities by country. Can anyone explain how to do this I've tried applying a custom expression in the show/hide formula to no avail.

Thanks for your help

Link to comment
Share on other sites

The Show/Hide rules work on the "lowest level" ofgraphical items in a visualization, in the case of a bar chart that is the individualsegments. So "show top 10" means showing the top 10 segments, not necessarily the top 10 complete bars.

If you read the help about "What is Show/Hide Items" there is a subsection "Rules Work on the Smallest Items" that describes this, and the subsection after that is called "Using OVER Expressions in Rules". OVER expressions can be used to calculate on (in this case) complete bars rather than segments.

According to the help:

the following boolean rule can be used to show the top three complete bars.

DenseRank(Sum([sales]) over (All([Axis.Color])),"desc")

Link to comment
Share on other sites

  • 1 year later...
  • 1 month later...

If someone is still looking for this and running into the same error "Could not find axis: 'Color'" the trick is how you configure the Show/Hide Rule. The right way to do it is to use the expression DenseRank(Sum([sales]) over (All([Axis.Color])),"desc") <= 10 in the field 'Column:' 

 

Then in the 'Rule Type' select Boolean and in the Value just add [Axis.Value].

 

The expression in 'Column:' itself should return a boolean and then the Value field just passes on the boolean to the rule

Link to comment
Share on other sites

  • 9 months later...
I'm getting the same error as Susan above. Getting an error message that axis 'Color' cannot be found. I have everything else the same. Any ideas The only Axis I'm getting is Axis.X - but that idn't limiting the chart to the top X values that I'm entering. 
Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...