Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

create stack and group bars in a same graph

hi all

i would like create actual and projection in group ,whereas stack bar needs to be used for Allocation

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

12 Replies
Gysbert_Wassenaar

Yes, add two dimensions to your chart and select the option Stacked on the Style tab. You will get groups of stacked bars in your chart. If you want Allocation stacked then make it the second dimension in the chart.


talk is cheap, supply exceeds demand
Not applicable
Author

Hi, by using below macro you can maintain both stacked an group style in single graph.

Sub ToggleChartBarStack

dim chart

dim cp

set chart = ActiveDocument.GetSheetObject("CH29")

set cp = chart.GetProperties

If cp.ChartProperties.BarModeStacked = true then

cp.ChartProperties.BarModeStacked = false

else

cp.ChartProperties.BarModeStacked = true

end if

chart.SetProperties cp

end sub

rohan_mulay
Partner - Creator
Partner - Creator

Hi Jayanthan,

Add 2 dimensions in a bar chart and 2 expressions and select Stacked style.

I have following data:

City,Population,Month

Mumbai,20,Jan

Pune,40,Jan

Mumbai,35,Feb

Goa,31,Jan

Mumbai,60,Mar

Pune,25,Feb

Pune,56,Apr

Goa,31,Feb

Goa,31,Apr

Add City and Month field in dimension and specify 2 expressions for the data. Here I have used following expressions:

=sum(Population+68)

=(sum(Population))

This gives following output where for City Goa we get Group of bars specifing Months and representing the values for both of the above expressions

grp.jpg

Anonymous
Not applicable
Author

Hi,

Look into attached file.

chart.PNG.png

Not applicable
Author

thank you all.

Sorry, i have miscommunicated earlier. I want Actual and Projection in Stack ,whereas allocation as another bar(since i do not how to have stack and group in  a same chart, i have put allocation in line chart). {

Please refer the below screen shot

Capture.JPG.jpg

Not applicable
Author

hi satya

it doesnt work for me. Kindly help to solve this issue

please refer the attached QVW

Anonymous
Not applicable
Author

See attachment

stack.PNG.png

Not applicable
Author

superb Satya

thank you .

Can i know where i went wrong

Jayanthan

Anonymous
Not applicable
Author

Hi Jayanthan,

You need to add "TypeID" in dimension of your chart and adjust expression with "Type" so that it will group in "Budget" and "Projection & Sales" category.

Thanks