Find range (or Max value minus Min value) for each unique building

I’m trying to figure out how to create a field that calculates the range (max minus min) of average element scores within each building. Each building has multiple users where the data would need to come from. Each user has a unique ID and an average element score tied to them.

The picture below shows the desired outcome. I was able to do create this table by using static values. Now that I’ve uploaded a new data pull from a separate date I would like to use a metric. All data is coming from a Google sheet.  

9f5196f1-326e-40e1-9512-14c94b4efce0.jpg
0 3 750
3 REPLIES 3

Seems like a SQL derived table would be well suited for this?

SELECT
  users.building_id,
  MAX(users.average_element_score)
- MIN(users.average_element_score)
AS range
FROM users
GROUP BY users.building_id

@fabio1 

I can’t seem to access the developer mode. I can only create reports, data sources, or use the explorer page. Do you have to pay to in order to access that part of Looker? Or am I missing something?

Is there any way to create a field within the dashboard that does that same thing?

Sorry if I asked the question in the wrong place. 

@fabio1

I can’t seem to access the developer mode. I can only create reports, data sources, or use the explorer page.

I would guess your company likely has a data team who is normally maintaining your company’s LookML model, who you may be able to ask to add this type of measure to the model. I would suggest trying to find them and asking!

Top Labels in this Space
Top Solution Authors