From looker-skills
Explains LookML field types (Dimension, Measure, Filter, Parameter, Dimension Group) and how the `sql` parameter behaves differently for each. Helps choose the right field type for data modeling.
How this skill is triggered — by the user, by Claude, or both
Slash command
/looker-skills:lookml-fieldsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
LookML fields are the building blocks of your data model. Each type serves a specific purpose in generating SQL.
LookML fields are the building blocks of your data model. Each type serves a specific purpose in generating SQL.
| Field Type | Purpose | SQL Generation Phase |
|---|---|---|
| Dimension | Describes data (attributes). Groups results. | SELECT and GROUP BY clause. |
| Measure | Aggregates data (metrics). Calculates results. | SELECT clause (with aggregation). |
| Filter | Restricts data based on conditions. | WHERE or HAVING clause (via templated filters). |
| Parameter | Captures user input for dynamic logic. | None directly (injects values into other fields). |
| Dimension Group | Generates time-based dimensions (type: time) or calculates date diffs/durations (type: duration). | SELECT and GROUP BY clause (multiple columns). |
sql ParameterThe sql parameter behaves differently strictly based on the field type.
GROUP BY clause.${TABLE}.col), other dimensions (${dim}), or raw SQL functions.dimension: full_name {
sql: CONCAT(${first_name}, ' ', ${last_name}) ;;
}
-- Generates: CONCAT(table.first_name, ' ', table.last_name)
SUM(sql)), or as a standalone calculation for type: number.type: sum/avg/min/max: References dimensions or columns.type: number: References other measures.type: count: sql is ignored (always COUNT(*) or COUNT(primary_key)).measure: total_profit {
type: sum
sql: ${sale_price} - ${cost} ;;
}
-- Generates: SUM(sale_price - cost)
sql_always_where.sql parameter in a filter field is rarely used directly in modern LookML. Instead, the input to the filter is used in {% condition %} tags.filter field or just a parameter + dimension.filter: date_filter { type: date }
-- Usage in Derived Table SQL:
-- WHERE {% condition date_filter %} created_at {% endcondition %}
{% parameter name %}) inside Dimensions, Measures, or Derived Tables.parameter: timeframe_selector {
type: unquoted
allowed_value: { value: "month" }
allowed_value: { value: "year" }
}
dimension: dynamic_date {
sql: DATE_TRUNC({% parameter timeframe_selector %}, ${created_raw}) ;;
}
type: time, generates multiple timeframes from a source timestamp. For type: duration, calculates time elapsed / date differences (e.g. month_since_signup, datediff) between two timestamps.dimension_group: created {
type: time
timeframes: [date, month]
sql: ${TABLE}.created_at ;;
}
-- Generates:
-- created_date -> CAST(table.created_at AS DATE)
-- created_month -> DATE_TRUNC(table.created_at, MONTH)
| Type | sql references... | Can reference Measures? | Aggregated? |
|---|---|---|---|
| Dimension | Columns, Other Dimensions | NO | No |
| Measure (Agg) | Columns, Dimensions | NO | Yes |
| Measure (Num) | Other Measures | YES | Yes (already agg) |
| Filter | (Rarely used) | No | N/A |
| Parameter | (None) | No | N/A |
For detailed standards on specific field types, refer to:
npx claudepluginhub looker-open-source/looker-skillsGuides LookML developers on defining and using sets to group fields for drill paths, explore visibility, and field exclusion.
Automates Looker dashboard creation: add elements, filters, and configure queries. Useful for data discovery and BI workflows.
Guides creation of Analytic Models in SAP Datasphere for SAP Analytics Cloud, defining reporting dimensions, measures (calculated, restricted, count distinct), currency/unit conversions, exception aggregations for dashboards, KPIs, and self-service BI.