12 Replies Latest reply: Mar 20, 2017 2:43 AM by Adam Brian

# Stack Bar Graph with Total

Hey guys,

I'm new in qlik sense, can anyone help me this one. Sorry if this has been answered before, I couldn't find the answer related.

I want show a stack bar graph with total workers by category, bar show full, and show in percent. Like this :

I try to create a company in one country with many braches on difference state. Total Branches in one State are diferrence, it based on which state we choose..

For example i choose State_A it will be like this:

and if i choose State_B it will be like this :

Graph will show based total branches in state which i selected. I tried using this extension, but it don't have stack bar graph.
GitHub - miclae76/trellis-chart: Qlik Sense Trellis Chart Extension
Can anybody help this one?

This is app that I tried to do : !

• ###### Re: Stack Bar Graph with Total

add a Dummy Dimension as below

DummyDIM:

AutoGenerate (2);

inChart

Use Calculated Dimension

=Pick(DIM,'TOTAL',DEPARTMENT)

Expression

sum([TOTAL WORKERS]) /sum(TOTAL  <DEPARTMENT> [TOTAL WORKERS])

• ###### Re: Stack Bar Graph with Total

Hi vinieme12,

Thanks for your answer. I tried your solution and it show total, but almost what i wanted. Can you help me.

Here the result with your solution,

1) TOTAL not show as dimension that i used.

2) Why Count for bar chart not same with real one?

• ###### Re: Stack Bar Graph with Total

Your dimensions are not correct, just keep the below two

Dimension1: =Pick(DIM,'TOTAL',DEPARTMENT)

Dimension2: UNIT

<< You don't need pick() for UNIT dimension

• ###### Re: Stack Bar Graph with Total

Hi vinieme12,

Thank it works.. But i need you to help me to change a little..

Below is the result after i change dimension.

What I need :
1) When i hover at bar, Can i see in UNIT by percentage and TOTAL WORKERS? each bar show percentage and TOTAL WORKERS

• ###### Re: Stack Bar Graph with Total

Try a dual expression

example

=DUAL(

'No of Workers:' & sum([TOTAL WORKERS]) & chr(10) &

'%of Workers:' & Num(sum([TOTAL WORKERS]) /sum(TOTAL  <DEPARTMENT> [TOTAL WORKERS]),'##.0%')

,

sum([TOTAL WORKERS]) /sum(TOTAL  <DEPARTMENT> [TOTAL WORKERS])

)

• ###### Re: Stack Bar Graph with Total

your expression become like this one..

what i really want like this :
unitD : 21%
TOTAL WORKRES : 123

It show two detail in time. Can you help me to show like this?

• ###### Re: Stack Bar Graph with Total

Give a name to your measure

• ###### Re: Stack Bar Graph with Total

It only shows only one value, when i rename. how to put 2 value?

AND

At top every bar chart, it show 100%, can we devide percent into every unit and show it in every unit?

• ###### Re: Stack Bar Graph with Total

I don't work with Qlik Sense, but after reading other threads for custom popups in sense...this doesn't seem possible at the moment

• ###### Re: Stack Bar Graph with Total

ohh, ok.. thanks for your help..

• ###### Re: Stack Bar Graph with Total

Hi vinieme12,

I have one more question, I only want to show in graph "TOTAL" + Top 2 department based TOTAL WORKERS + "OTHER".

I already tried, but dont happen what i nedd.. can you help me?