Adam Wilson 2 Posted June 23, 2016 Share Posted June 23, 2016 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 More sharing options...
Manish Patel 2 Posted June 23, 2016 Share Posted June 23, 2016 Right click >> Properties >> Data >> Limit Data Using Expression >>Rank([capacity],"desc",[country]) < 6 Link to comment Share on other sites More sharing options...
Anders Gavare Posted June 27, 2016 Share Posted June 27, 2016 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 More sharing options...
Adam Wilson 2 Posted June 28, 2016 Author Share Posted June 28, 2016 Thank you! Link to comment Share on other sites More sharing options...
Susan Wallenslager Posted June 14, 2018 Share Posted June 14, 2018 I have the exact same situation in a visualization. When I use an expression of the form: DenseRank(Sum([Value]) over (All([Axis.Color])),"desc") <= 10 I get an error message that says: Could not find axis: 'Color'. Any ideas Link to comment Share on other sites More sharing options...
Susan Wallenslager Posted June 14, 2018 Share Posted June 14, 2018 Doing the equivalent of this in my visualization is having no effect: Right click >> Properties >> Data >> Limit Data Using Expression >> Rank([capacity],"desc",[country]) < 6 I also get no error messages. Any ideas Link to comment Share on other sites More sharing options...
Angad Sodhi 2 Posted August 7, 2018 Share Posted August 7, 2018 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 More sharing options...
Susan Wallenslager Posted August 8, 2018 Share Posted August 8, 2018 Thank you - This worked like a charm! Link to comment Share on other sites More sharing options...
David Jones 5 Posted June 4, 2019 Share Posted June 4, 2019 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 More sharing options...
Shamil Salam Posted August 20, 2020 Share Posted August 20, 2020 The Dense Rank expressino works except for when I have ties. I tried replacing DenseRank with Rank and addign ties.method = first. But this doesn't work either. Any suggestions Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now