Converting dimension to a measure

Hi,

I’m struggling with creating some basic graphs in Looker. 

Although I’ve already setup some dashboard, this kind of basic things do not seem to work as I expected.

The visual I’m trying to create is a line-bar, with a time-dimension on the X-axis, a certain value on the Y-axis and multiple lines for different categories of a dimension (in this case countries).


By generating the view, Looker converts my numeric column (the certain value) into a dimension. As I understand, to view this as a value into a visualisation, I have to write a LookML measure of this value.

32f92784-dfa7-493d-99aa-265acfad6c35.png

Intuitively, for creating my line bar, I would set up the explore data as follows:

e091bda8-f910-4b2f-9ed6-c8a5df4763c6.png

But this won’t run except I add my value dimension. By adding the value dimension, it gets added as a group by, which is of course not what I want and won’t result in getting my graph.

Any thoughts on how I could fix such problem?

Solved Solved
0 2 6,414
1 ACCEPTED SOLUTION

Hi mathias.luyten,

You are correct that dimensions are in the group by part of the query. As the measure is type number, you’ll end up with an error as this technically there’s no aggregation on this field.

If you change the type to sum, this should fix your issue.

Hope this helps,

Naomi

View solution in original post

2 REPLIES 2

Hi mathias.luyten,

You are correct that dimensions are in the group by part of the query. As the measure is type number, you’ll end up with an error as this technically there’s no aggregation on this field.

If you change the type to sum, this should fix your issue.

Hope this helps,

Naomi

Thanks! When specifying the measure as ‘sum’ it does not require to take the dimension of the value in the group by, ideal!

Top Labels in this Space