How to make grouped column visualization out of simple select?

I want to do a column chart with multiple groups (just like the first one described on https://cloud.google.com/looker/docs/column-options). For that I have a very simple select statement: `SELECT x, y1, y2, y3 FROM atable` where I want to have groups of y1, y2, y3 for every x point. How should I transform this select statement so column visualization will recognize it as applicable for grouped display?

0 2 132
2 REPLIES 2

Assuming I understood the problem correctly:
This is not the best approach but you can write 3 select statement for each of Y1, Y2 & Y3 & Union them as shown below.
Ex:
(select CONCAT(‘Y1’, ‘-’, Y1) as Y, X from atable)
UNION
(select CONCAT(‘Y2’, ‘-’, Y2) as Y, X from atable)
UNION
(select CONCAT(‘Y3’, ‘-’, Y3) as Y, X from atable)

You can achieve this by pivoting on x . Looker will do the rest for you 🙂

Top Labels in this Space
Top Solution Authors