Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
My data is organized below and I would like to make a bar graph with the dimension being Company and the graph will show the distribution of gender (Male/Female) for each company. (e.g. For A, it will show two bars, first bar is 40% for Male and second bar is 60% for Female) Is this possible to do it inside set analysis? I don't want to create a separate table from the main one.
Company | Male | Female |
A | 20 | 30 |
B | 30 | 20 |
C | 10 | 12 |
All help and feedbacks are appreciated! Just let me know if you guys need more details.
You can do it 2 ways
1 with the current table structure
Company as dimension and expressions Sum(Male)/Sum(Male+Female) and Sum(Female)/Sum(Male+Female)
2 this in my opinion is the more flexible option. you transform the table using cross table to
CrossTable (Sex,Count,1)
load * inline [
Company, Male, Female
A, 20, 30
B, 30, 20
C, 10, 12
];
Company | Sex | Count |
A | Male | 20 |
A | Female | 30 |
B | Male | 30 |
B | Female | 20 |
C | Male | 10 |
C | Female | 12 |
this make the datamodel more flexible
then create bar chart with dimensions Company and Sex
measure Sum(Count)/Sum(total <Company> Count)
You can do it 2 ways
1 with the current table structure
Company as dimension and expressions Sum(Male)/Sum(Male+Female) and Sum(Female)/Sum(Male+Female)
2 this in my opinion is the more flexible option. you transform the table using cross table to
CrossTable (Sex,Count,1)
load * inline [
Company, Male, Female
A, 20, 30
B, 30, 20
C, 10, 12
];
Company | Sex | Count |
A | Male | 20 |
A | Female | 30 |
B | Male | 30 |
B | Female | 20 |
C | Male | 10 |
C | Female | 12 |
this make the datamodel more flexible
then create bar chart with dimensions Company and Sex
measure Sum(Count)/Sum(total <Company> Count)