6 Replies Latest reply: Sep 14, 2015 11:13 AM by Claus Reinhard RSS

    Color Bar Chart dependent on Total Number of Bars

    Claus Reinhard

      Hi everyone,

       

      I have a little problem with Coloring my Bar Chart. I managed to show only my top and bottom 5 dimensions for my expression. This works fine. I also managed to color my top 5 green and my bottom 5 red.

       

      Capture.PNG

       

      The code for my dimension:

       

      =aggr(  if(  rank(avg(<Expression>))<=5 or   rank(-avg(<Expression>))<=5  ,<Dimension>) ,<Dimension>)

       

      The code for my color:

       

      =If (Rank(avg(<Expression>)) <6, Red(), if (Rank(<Expression>)) > 5, Green()))

       

      As stated above, this all works satisfying. My problem starts when the user selects something in one of the Listboxes and the total amount of rows is reduced to less than 10.

       

      Capture.PNG

      As you see, this are for of my best five rows from the Screenshot above. They are displayed in red because there are only 4 rows displayed in the Bar Chart. Therefore my question:

       

      Do you know any possibility how to get a standard color like grey for my chart, if the total count of displayed rows in the chart is less than 10?

       

      Something like RowNum(TOTAL) or NoOfRows did not work in that case.