superset icon indicating copy to clipboard operation
superset copied to clipboard

Cannot group by other than strings

Open florianmonfort opened this issue 8 years ago • 2 comments

Make sure these boxes are checked before submitting your issue - thank you!

  • [ ] I have checked the superset logs for python stacktraces and included it here as text if any
  • [x] I have reproduced the issue with at least the latest released version of superset
  • [x] I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

0.24.0

Expected results

Group by our ID column

Actual results

Can only select some specific columns in GROUP BY

Steps to reproduce

  • Add the table;
  • Open table to create a slice;
  • Try to Group by ID column;

Hi,

I have a table with menu items from restaurants. In this table we added for each menu item the associated restaurant ID. So multiple rows can have the same associated "restaurant_id".

So I am trying to get the average number of items per restaurant_id. But in GROUP BY, I cannot select that column:

image

However in "Not group by" that column appears as usable:

image

This might not be a bug at all but maybe just my lack of technical skills which means there is something I don't know about how DBs and SQL work 😅. I apologize in advance if that's the case, I just haven't figured out where to get an explanation anywhere else.

florianmonfort avatar May 04 '18 03:05 florianmonfort

You need to first edit the table and make the column 'Groupable'. github-superset

ianshan0915 avatar May 04 '18 20:05 ianshan0915

Ok that's what I thought.. Noob question haha. Thanks! You can close this issue.

florianmonfort avatar May 07 '18 08:05 florianmonfort