Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

manigunta
Contributor

Horizontal stacked bar chart with one dimension

Hi,


I have one dimension which is product type and I need to show the sum of each product type in a horizontal stacked bar chart with only one bar. Please see example below.

Untitled.png

Anyone could help with this?

thanks

1 Solution

Accepted Solutions
gladi-cz
Contributor

Re: Horizontal stacked bar chart with one dimension

In this case you have to modify your data in script.

This is my data definition:

//data definition

Data:

Load * Inline [

    ProductCategory, Qty

    A, 20

    B, 30

    C, 50

];


For your uses you have to create fictive group Product:

//data modification

DataModified:

NoConcatenate Load

'Product' as Product,

*

Resident Data;

Drop table Data;


After, you can create bar chart with two dimension ProductCategory and Product and also you can change type of chart to stack in presentation menu.


I added qvf.


Have a nice day,

Petr

12 Replies
etrotter
Contributor II

Re: Horizontal stacked bar chart with one dimension

Hi,

Add both dimensions by using the "add data" button. Have the one you want the whole bar defined by first, and add a measure such as quantity of the products. Next Click on "Appearance" and under presentation click on "stacked" and "horizontal". Next under "Colors and Legend"  under colors unswitch Auto and select by dimension. In the formula bar put the dimension you would like the bar to be separated by.

manigunta
Contributor

Re: Horizontal stacked bar chart with one dimension

HI

i am using qliksense desktop version,under presentation, i am not able to see 'stacked' option, where ca i find stacked option.

gladi-cz
Contributor

Re: Horizontal stacked bar chart with one dimension

Hi nagamani,

It's not so hard, could you share .qvf?

Petr

manigunta
Contributor

Re: Horizontal stacked bar chart with one dimension

hi,

i am not able to share qvf, can you please provide me scvreenshot as where i can select "Stacked" Option

gladi-cz
Contributor

Re: Horizontal stacked bar chart with one dimension

In this case you have to modify your data in script.

This is my data definition:

//data definition

Data:

Load * Inline [

    ProductCategory, Qty

    A, 20

    B, 30

    C, 50

];


For your uses you have to create fictive group Product:

//data modification

DataModified:

NoConcatenate Load

'Product' as Product,

*

Resident Data;

Drop table Data;


After, you can create bar chart with two dimension ProductCategory and Product and also you can change type of chart to stack in presentation menu.


I added qvf.


Have a nice day,

Petr

gladi-cz
Contributor

Re: Horizontal stacked bar chart with one dimension

I add result.

Screen.JPG

ramasaisaksoft
Valued Contributor III

Re: Horizontal stacked bar chart with one dimension

philgood34
Contributor II

Re: Horizontal stacked bar chart with one dimension

Hi

here is the screenshot (sorry, it's french)

stacked.png

Regards

Philippe

ramasaisaksoft
Valued Contributor III

Re: Horizontal stacked bar chart with one dimension

I hope you already know for a stacked bar chart we need more than 1 Dimension and at least 1 expression required then only in Appearance -->Presentation-->Stacked will visible to you.