How do I sum values of a measure based on values of dimension?

Hi everyone, 

Is there a simple way to sum the Positions Vacant measure by the Business Division field?

The data as it is is fine - what we really want to do is simplify the bar chart visualisation.

Our team has only started using Looker recently (through PageUp), so any tips or tricks would be appreciated!

73433dec-99bf-4181-a252-6314e98a024e.png
1ffbe958-721c-4720-b795-93ceddca239c.png
Solved Solved
1 2 223
1 ACCEPTED SOLUTION

You can use sql_distinct_Key as “Business Division” dimension in measure definition to get the results summed up at business division.

sample code below:

view: view_name {
  measure: field_name {
    type: sum_distinct
    sql_distinct_key: ${my_field_name} ;;
  }
}

View solution in original post

2 REPLIES 2

What is the other dimension you have before Job Business Division? That’s what changes the  granularity. If you remove it you will have the measure aggregated by Businsss Division field.

You can use sql_distinct_Key as “Business Division” dimension in measure definition to get the results summed up at business division.

sample code below:

view: view_name {
  measure: field_name {
    type: sum_distinct
    sql_distinct_key: ${my_field_name} ;;
  }
}

Top Labels in this Space