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

100% stacked column chart in Qlikview?

I need to create a bar chart in Qlikview that displays information of 2 dimensions (period and segment) and 1 expression (value in%), that total 100% in the bars.

Sum (Value) / Sum (Total Value).

When I use the "Total" or "All", the chart considers the value of all periods, when in fact I should only consider the total per period. I have already tried to use the Aggr expression, but it gives miscalculation.

Aggr (Sum (Value) / Sum (Total Value), Period).

I believe that Set Analysis does not apply to this calculation, since it will always consider the total value (of all periods).

In another environment, this graph is native and is called "100% Stacked Column Chart", as shown below.

grafico.png

Is it possible to reproduce this graph in Qlikview?

Tks!!!

1 Solution

Accepted Solutions
oscar_ortiz
Partner - Specialist
Partner - Specialist

Karen,

I believe you need to remove your "{}" curly brackets.

Try this:

Count( CPF_CNPJ ) / Count( TOTAL <Periodo_Movimentacao> CPF_CNPJ  )

Good luck

Oscar

View solution in original post

7 Replies
effinty2112
Master
Master

Hi Karen,

Try

Sum (Value) / Sum (Total <Period> Value)


Good luck


Andrew

oscar_ortiz
Partner - Specialist
Partner - Specialist

You can try an expression like the following:

Sum (Value) / Sum (Total <Period> Value)


Change your chart properties under style select Stacked:


276294-1.PNG

Your result should look something like this:

276294.PNG

Good Luck

Oscar


Anonymous
Not applicable
Author

Oscar,

Thank you for your answer.

I tried but doesn't work like your example. Bellow:

1.png

oscar_ortiz
Partner - Specialist
Partner - Specialist

Karen,

I believe you need to remove your "{}" curly brackets.

Try this:

Count( CPF_CNPJ ) / Count( TOTAL <Periodo_Movimentacao> CPF_CNPJ  )

Good luck

Oscar

Anonymous
Not applicable
Author

Thank you so much Oscar! It worked

Anonymous
Not applicable
Author

Hi Oscar,

Again I need to make this rule, but now also using Set Analysis, and following the same rule, doesn't return 100%

For Example:

Count({$<Code={"10"}>}Id)/Count(Total <Month,Day> {$<Code={"10"}>}Id)

grafico.png

oscar_ortiz
Partner - Specialist
Partner - Specialist

Karen,

Could you possibly provide some sample data with an explanation of what you are trying to do?

In your image what do the values in the legend associate to?

For the expression that you have it looks like you are simply trying to look at the Code=10 by date.  Do you have an actual date field in your data model?  Rather than using the Month and Day.  Or possibly change your expression to use whatever value you have in your legend rather than the date.

Good luck

Oscar