Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
Anyone could help with this?
Many Thanks
Paulo
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.
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
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),
)
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
];
Hi,
one solution might be:
hope this helps
regards
Marco
Hi Marco,
Works perfect. Thats is exactly what I looking for.
Many Thanks
Paulo
Hi Nick,
I have tested this approach and it works as well.
Many thanks for you support.
Paulo
you're welcome
glad it worked
regards
Marco