Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to create stacked chart

HI,
i have some country data which is in percentage and i want to creat a stacked chart which must be of 100% but whn i am creating a chart and in the "USED DIMENSION" i have taken Countries and in the Expressions i have taken the percentage values, the chart i am getting is a usual bar chart, can any one tell how to convert it into stacked chart, i tried the option of Staked in the Style tab but it is diable, and one more condition is that if the total of the all the values is not 100% even then also the all the values must be rounded such that the total comes 100%
Any help will be greatly appreciated, PFA file for your reference

3 Replies
Not applicable
Author

Try this

Create in your script a new dimesion :

1 as NewDim

Dimensions : NewDim , country

Expression :    sum(Value)  / sum(  ALL <NewDim> Value)  where value is your metric not necessary a percentage.

Style :  subtype : Stacked

JJ

Not applicable
Author

hi JJ,
Sorry for the late response, Can u explain where do i have to type "Style: subtype: stacked" if i go in chart properties there are few pre-defined chart type are available and what is the newdim as u mentioned

Not applicable
Author

Hi Mo

Look at the attachments to see where is the subtype stacked

I have to create new dimension in the scrip or in the chart to allow stacking the expression

Look at the qvw

JJ