Skip to content
BENIBIX Learn

LookML

Also known as Looker Modeling Language, LookML Model

The code that tells Looker what tables, fields and numbers mean.

Think of it like

It is like a label on each jar in the kitchen. Once the jars have labels, anyone can cook.

Example

Emma adds a refunds measure to the orders view. Once it is checked, every Looker user can put refunds on a chart.

Why it matters

SQL is often spread across many reports. LookML turns it into one set of rules that people check.

Definition

LookML is the language used to describe data in Looker. A view file maps to a table. It lists its dimensions, the fields you group by, and its measures, the numbers you add up. An explore says which views can be joined together. Looker reads these files and writes the SQL for each question. LookML files live in Git, so changes can be reviewed.

Example code

lookml
view: orders {
  sql_table_name: analytics.orders ;;
  dimension: status {
    type: string
    sql: ${TABLE}.status ;;
  }
  measure: total_revenue {
    type: sum
    sql: ${TABLE}.amount ;;
  }
}
One view: a field to group by, and a number to add up. Looker writes the SQL from this.
LookML is what fills the middle box: the revenue rule and the fields beside it.

Common mistake

Writing one huge view with hundreds of fields. Users get lost. Keep views small and named the way people talk.

Key takeaways

  1. 1
    Views. One per table, with its fields.
  2. 2
    Dimensions and measures. Group by one, add up the other.
  3. 3
    Kept in Git. Reviewed like any other code.