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

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?

Many Thanks

Paulo

1 Solution

Accepted Solutions
MarcoWedel

Hi,

one solution might be:

QlikCommunity_Thread_225143_Pic1.JPG

QlikCommunity_Thread_225143_Pic2.JPG

QlikCommunity_Thread_225143_Pic3.JPG

QlikCommunity_Thread_225143_Pic5.JPG

QlikCommunity_Thread_225143_Pic4.JPG

hope this helps

regards

Marco

View solution in original post

8 Replies
NickHoff
Specialist
Specialist

Dimension: ProductType

Expressions use show value on data points, and bar options:

SUM({$<ProductType = {'A'}>}ProductType)

SUM({$<ProductType = {'B'}>}ProductType)

SUM({$<ProductType = {'C'}>}ProductType)

SUM({$<ProductType = {'D'}>}ProductType)


On the style tab select stacked sub-type.

Not applicable
Author

Hi Nick

Thanks for your reply.

Unfortunately didn't work. It will create 4 bars in the chart (one by expression).

The objective is to SUM the Number of products by product type and show it in one column only. (like the image above)

Any ideas?

Thanks

Paulo

NickHoff
Specialist
Specialist

Create a PICK into one expression.

Use an Inline table to generate the description of product type, and an id for each one.  The order of the PICK is the order of your id(s).

PICK(PickProductTypeId,

SUM({$<ProductType = {'A'}>}ProductType),

SUM({$<ProductType = {'B'}>}ProductType),

SUM({$<ProductType = {'C'}>}ProductType),

SUM({$<ProductType = {'D'}>}ProductType),

)

NickHoff
Specialist
Specialist

Forgot to mention your dimension would be your PickProductTypeDescription that you created in the inline table, like the following.

ProductTypePick:

LOAD * INLINE [

    %PickProductTypeID, %PickProductTypeDescription

  1, A

  2, B

  3, C

  4, D

];

The above will still give you 4 different dim values, so you'd have to add a 3rd field like the following and use the 3rd field for your Dim:

ProductTypePick:

LOAD * INLINE [

    %PickProductTypeID, %PickProductTypeDescription, '%PickAggrDesc

  1, A, ProductType

  2, B, ProductType

  3, C, ProductType

  4, D, ProductType

];

MarcoWedel

Hi,

one solution might be:

QlikCommunity_Thread_225143_Pic1.JPG

QlikCommunity_Thread_225143_Pic2.JPG

QlikCommunity_Thread_225143_Pic3.JPG

QlikCommunity_Thread_225143_Pic5.JPG

QlikCommunity_Thread_225143_Pic4.JPG

hope this helps

regards

Marco

Not applicable
Author

Hi Marco,

Works perfect. Thats is exactly what I looking for.

Many Thanks

Paulo

Not applicable
Author

Hi Nick,

I have tested this approach and it works as well.

Many thanks for you support.

Paulo

MarcoWedel

you're welcome

glad it worked

regards

Marco