What is the expected return order of columns for graphing results when using raw SQL?

I’m trying to get data visualization working for a custom SQL query, but it either doesn’t graph correctly or at all. What should the results of a query look like (ordering, format, etc) to allow it to be graphed effectively?

The current code expects that the dimension column will be returned first, then followed by the metric value.

For example, if you wanted to sum your revenue and then group it by day you might write SQL like this (for postgres) …

SELECT timestamp::date as day, sum(revenue) as revenue
FROM my_table

So, I assume graphing multiple dimensions isn’t yet supported? For example, this query returns fine in table view, but all I get when selecting charts is empty charts (via latest github source):

select month || '/' || year as date, business_unit, sum(cost) from expenses group by date, business_unit