TeamSQL / desktop-app

This repository is currently being used for hosting the official issue & bug tracker of TeamSQL Desktop App.
102 stars 6 forks source link

Ability to make stacked bar chart from 1 Measure and 2 Dimensions? #418

Open actonacademy1 opened 5 years ago

actonacademy1 commented 5 years ago

All the examples I've seen for stacked bar charts in TeamSQL use multiple Measures and only 1 Dimension. This feels column-oriented (Excel-like) rather than row-oriented like everything else in database-land.

Example: I have a database for a network of schools. There are lots of schools, and within each school there are several types of users (students, teachers, administrators, etc. - user types are the same from school to school).

Let's say I want to make a stacked bar chart showing number of users by school and user type, where each bar represents a school, and coloring/stacking is done by user type. In other tools I've used (Tableau, Google Data Studio, etc.), I would accomplish this by having 2 dimensions (school and user type) and 1 measure (count distinct of user id). However, all examples for TeamSQL I've seen for this kind of chart use 1 Dimension (school) and then as many Measures (separate columns) as I have user types (1 column per user type). In order to accommodate that data structure I'd have to write a much more complex query, and it feels very unnatural for users thinking in terms of normalized database tables.

Is what I'm describing already possible and I'm just not figuring out how to do it? If not, is there a reason for choosing column-oriented data structures? Thanks!

selcukayhan commented 5 years ago

Hi @actonacademy1 ,

Here is your solution, you can add more dimensions and measures with clicking '+' icon near 'Dimensions' title. After that you can see rates with coloring of a bar element and also if you want to more detailed data you can see that when you move your mouse over a bar.

You can see your solutions example below. Thank you. dimensios