Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm trying to create a bar chart with two dimensions on the same x-axis.
Here's an example to illustrate, I have a dimension: Clothes-type (including Shirt, pants, Skirt, Shoes and Scarf), and a measure Sales.
I have another dimension: Color of these clothes. Specifically, I want to see the Sales of these clothes which are red, and I want to put it together with Sales by Clothes-type in the same bar chart.
The desired bar chart is shown below.
Do you have any idea how to achieve this preferably in the chart expression (instead of script)?
Thanks in advance!
Sales | |
Shirt | 2 |
Pants | 5 |
Skirt | 3 |
Shoes | 4 |
Scarf | 1 |
Red | 7 |
Something like below ?
Table:
Load * Inline [
Clothes, Color, Sales
Shirt,Red,10
Shirt,Yellow,20
Shirt,Black,10
Pants,Red,25
Pants,Blue,40
Shoes,Red,30
];
Concatenate
RedClothes:
Load
Sales,Color,
Color as Clothes
Resident Table Where Color = 'Red';
Hi,
How do you define which cloths are red ?
E.g
If you have data like below, you can use stacked bar chart to identify Sales of Red cloths.
Table:
Load * Inline [
Clothes, Color, Sales
Shirt,Red,10
Shirt,Yellow,20
Shirt,Black,10
Pants,Red,25
Pants,Blue,40
Shoes,Red,30
];
Output :
Or you can share sample data with column 'Color of clothes'.
Thanks,
Ashutosh
Hi Ashutosh,
Thank you for your reply.
Indeed I have data like that.
However, Is there possibility to have 'Red' as a bar itself instead of stacked bar? (Just as what I showed in my post).
This is because we are only interested in seeing the sum of 'Red' clothes.
Best Regards,
Cheryl
Something like below ?
Table:
Load * Inline [
Clothes, Color, Sales
Shirt,Red,10
Shirt,Yellow,20
Shirt,Black,10
Pants,Red,25
Pants,Blue,40
Shoes,Red,30
];
Concatenate
RedClothes:
Load
Sales,Color,
Color as Clothes
Resident Table Where Color = 'Red';