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

Bar Chart: 1 Dimension + 2 Expressions = 1 Bar/Dimension

Hi,

I have a Bar chart with 1 dimension and 2 expressions.

For example:

Dimension = Chocolate (Black, white,...)

Expression1 = Number of chocolate available for the color

Expression2 = Total number of chocolate available

I am trying to get the following rendering:

# = Bar for Expression1

+ = Bar for Expression2

           0 2   5                  15

Black   #####++++++++++

White   ##+++++++++++++

Instead I have:

Black   #####+++++++++++++++

White   ##+++++++++++++++

How do I tell Expression2 bar to start at 0 and not after Expression1 bar ends (no stacking)?

1 Solution

Accepted Solutions
Not applicable
Author

Try this

if(expression2=0,0,expression2-expression1)

View solution in original post

8 Replies
Not applicable
Author

Try this

if(expression2=0,0,expression2-expression1)

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Check whether you used the option in the Properties-->Style Tab-->under subtype use Grouped instead of stacked.

Celambarasan

Not applicable
Author

@Marc: Thanks it works. Isn't there a "cleaner" way to do that?

@Celambarasan: With subtype "Grouped" the 2 expressions are next to each other, Expression1 does not cover Expression2. I am basically trying to do a stacked bar chart where all expressions results starts at 0.

Not applicable
Author

If expression 2 is always the total of the charts expression1 then you should be ok with a simple

Expression2 - Expression1

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,    

     Use Expression1:Sum(Chocolates)

     Expression2:Sum(Total Chocolates)-Sum(Chocolates)

Celambarasan

Not applicable
Author

I was more thinking of a check box or a parameter I would have missed instead of using a formula

Not applicable
Author

Not that I am aware of. The "Stacked" option just means stack, not overlay. To get what you want you will always have to subtact one of the expressions from the total expression

Not applicable
Author

Thanks again Marc