Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Hide some legends in Bar Chart based on set analysis

I’m trying to get a bar chart legend to only show the legend if there is a valid entry for that month.

 

There are five expressions like this:      =Sum({<Month>}CostsP5)/Sum({<Month>}Costs)

               

And the Label for each is like:

    =NameP5

I’ve tried changing the label to:      =If(Len(NameP5)>0,NameP5,'')

      Any ideas?

6 Replies
sunny_talwar

But we do see Grey and other colors in the chart, shouldn't the legend show this info? May be try this

=Only({<Month>} NameP5)

Anonymous
Not applicable
Author

They are, but the projects can change over the year so that Project 2 in February will be different from Project 2 in November. I only want to show the legend for projects running in the current month, but leave the chart showing all projects.

sunny_talwar

I think this might be challenging to do it this way... can you may be do this with 2 dimensions and 1 expression, instead of 1 dimension and 5 expressions?

Anonymous
Not applicable
Author

The data looks something like this:

   

MonthYearProgramme 1Programme 2Programme 3Programme 4Programme 5Costs Programme 1Costs Programme 2Costs Programme 3Costs Programme 4Costs Programme 5
Jan-18AJHSRNCPRPNOct10050201010
Feb-18AJHSRNCPRPNOct8020702020
Mar-18Project 1AJHBBJ 602010
Apr-18Project 1AJH 12030
May-18Project 1 150
Jun-18
Jul-18
sunny_talwar

And do you use CrossTable load to transform your data?

Anonymous
Not applicable
Author

We don't. There's a lot more on each line, although a lot of them are also broken down by Programme.