Grouping per dimension before calculation

Hi community,

I am new to Looker and still getting the hang of the Looker way, and I am running into problems with how to group the data, I am working with.

I have a lowest-level table where each row represents a product in an order. We only want to look at some of them, so a custom dimension is made where the number for these lines is displayed.

Now I need to group all these lines per order and then multiply that number by a constant and view them per day.

So far I have only been able to either sum all the lines before multiplying or multiplying the initial individual lines, both of which does not give the result we need.

 

I hope you can help! 🙂

0 3 50
3 REPLIES 3

You can create a suitable measure according to the calculation you need,
then go to respective explore and add the line columns that you want to group,
add day and measure and visualize.
You can hide the line columns from visual by selecting Hide option from column settings in data pane.
By this method you will have the grouped calculation of a measure and the line columns will be hidden from visualization.

My problem is that initial measure. I can make a measure in LookML with table.column*calculation, but that will give me the calculation per line and not grouped by order.
So how do you in LookML make it sum(table.column grouped by order)?

I'll try to include an example:

orderindividual line
110
120
220

I need to do the calculation per order. So as an example, if my calculation was to minus 5, the result I am looking for is:
order 1 - 25 ((10+20)-5)
order 2 - 15 (20-5)

But I have so far only figured out to do it per line, so I end up with this, as it does the calculation first before I can do sum, as I can't figure out how to group:
order 1 - 20 ((10-5)+(20-5))
order 2 - 15 (20-5)

Here, you can convert your measure as a dimension and when you go to explore to visualize it then you can right click the same dimension and select aggregate>sum, then select the order column, you will have the values grouped.

 

Top Labels in this Space
Top Solution Authors