I have dataset of classes and students admitted in class
Class Name, Girls Seat, Boys Seat
I know that total seats in each class is 100
I want to create a pie chart which represents admitted vs vacant seat
For eg
If in the filter class 1st is selected the pie will show the values of girls, boys seat and “100-girls seat-boys seat” as unadmitted Data in the pie chart similarly if
Class 1 and 2 both are selected, thepie will show girls in class 1+girls in class 2 as girls seat, boys in class 1 + boys in class 2 as boys seat and unadmitted Data by subtracting these 2 from 200, how is there any way to represent this in pie chart as I came to know we can’t select 2 fields in value of pie chart or should I opt for other visuals Please suggest
hi @Tanu_13 ! Pie chart can work for your scenario, if you don’t need to see the individual classes when multiple classes are selected. If you DO want to see distribution of seats across classes to visually compare, something like a stacked bar would show each class and the distribution of boys/girls/vacant.
[EDIT] The “single measure” idea doesn’t work here, so we need visuals that can accept > 1 measure in the axis [i.e. boys seats, girls seats, vacant seats]. Stacked bar works well!
your Vacant Seats would look something like this, multiplying seats by number of classes:
100*distinct_count({Class Name})-sum(Girls)-sum(Boys)
here are some ideas for you. i like the stacked bar, but the “clustered” version works if you want to compare boys vs girls.
Where to put the formula for vacant seats @xrusjohn
On the far left side in your analysis where you see the # Boys and # Girls fields, use the button + CALCULATED FIELD. In the example above I just called it Vacant.
Thanks @xrusjohn this works
I was thinking of expanding this visual,The second visual that we have in above image which has three bars for each class, Is it possible to apply group by field to that 3 bars, For example I want the 3 bars to be grouped by school name fields . Suppose we have date from different schools too.
Is this possible
Glad that helped, Tanu! While you can’t easily nest two dimensions in the y axis, I’d try something that shows vacancy by school, then activate a second visual with a “drill down” into seats by class. Also consider you have more options for visuals if you’re on a single metric: show vacant seats by school, and stack up the classes for example. Add other attributes like what subject or level is the class, and build a dashboard that shows different cuts. Rank the schools, subjects, classes by vacancy. Top 3/bottom 3 vacant classes, classes most attended by girls. Maybe look over time, how has the mix changed from last year?
In summary, I’d suggest multiple visuals to look at the data in different ways instead of overloading one visual with too many levels and details.
