lkrdev/lookml_skills

lookml-fields

Overview of LookML field types (Dimension, Measure, Filter, Parameter) and the role of the `sql` parameter in each. Use this skill to choose the right field type for your data modeling needs.

First seen Mar 19, 2026

Installation

$ npx skills add lkrdev/lookml_skills --skill lookml-fields

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from lkrdev/lookml_skills.

npx skills add lkrdev/lookml_skills

Browse all from lkrdev/lookml_skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 13
License LICENSE
Default branch main
Open issues 1
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 5,117 B
  • docs SUMMARY.md 212 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 55 installs

SKILL.md

Instructions

1. Field Types Overview

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 a set of time-based dimensions. SELECT and GROUP BY clause (multiple columns).

2. The Role of sql Parameter

The sql parameter behaves differently strictly based on the field type.

Dimensions: The "What"

  • Role: Defines the raw transformation of the column before any aggregation.
  • SQL Context: The expression is placed directly into the GROUP BY clause.
  • Input: Can reference table columns (${TABLE}.col), other dimensions (${dim}), or raw SQL functions.
  • Example:

``lookml dimension: fullname { sql: CONCAT(${firstname}, ' ', ${lastname}) ;; } -- Generates: CONCAT(table.firstname, ' ', table.last_name) ``

Measures: The "How Much"

  • Role: Defines the value to be aggregated or the calculation involving other aggregates.
  • SQL Context: Puts the expression inside the aggregation function (e.g., SUM(sql)), or as a standalone calculation for type: number.
  • Input:

For type: sum/avg/min/max: References dimensions or columns. For type: number: References other measures. For type: count: sql is ignored (always COUNT() or COUNT(primary_key)).

  • Example:

``lookml measure: totalprofit { type: sum sql: ${saleprice} - ${cost} ;; } -- Generates: SUM(sale_price - cost) ``

Filters: The "Which"

  • Role: Defines the condition logic, usually for Templated Filters used in Derived Tables or sqlalwayswhere.
  • SQL Context: The sql parameter in a filter field is rarely used directly in modern LookML. Instead, the input to the filter is used in {% condition %} tags.
  • Best Practice: Identify if you need a filter field or just a parameter + dimension.
  • Example (Templated Filter):

``lookml filter: datefilter { type: date } -- Usage in Derived Table SQL: -- WHERE {% condition datefilter %} created_at {% endcondition %} ``

Parameters: The "User Input"

  • Role: Does NOT generate SQL itself. It holds a user-selected value to be injected into other fields.
  • SQL Context: Accessed via Liquid variables ({% parameter name %}) inside Dimensions, Measures, or Derived Tables.
  • Input: User selects from a UI list or types a value.
  • Example:

``lookml parameter: timeframeselector { type: unquoted allowedvalue: { value: "month" } allowedvalue: { value: "year" } } dimension: dynamicdate { sql: DATETRUNC({% parameter timeframeselector %}, ${created_raw}) ;; } ``

Dimension Groups: The "Time Generator"

  • Role: Defines the source timestamp or date column. Looker then generates multiple dimension fields based on the timeframes list.
  • SQL Context: Casts and truncates the source column for each timeframe.
  • Input: Must be a standardized timestamp or date expression.
  • Example:

``lookml dimensiongroup: created { type: time timeframes: [date, month] sql: ${TABLE}.createdat ;; } -- Generates: -- createddate -> CAST(table.createdat AS DATE) -- createdmonth -> DATETRUNC(table.created_at, MONTH) ``

3. Summary of Differences

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
Value Format (None) No N/A

Reference Skills

For detailed standards on specific field types, refer to:

  • [Dimensions](references/dimension.md): Naming, labels, and type-specific rules.
  • [Measures](references/measure.md): Aggregation types, filters, and formats.
  • [Filters & Parameters](references/filter_parameter.md): Templated filters and user input.
  • [Dimension Groups](references/dimension_group.md): Timeframes and intervals.
  • [Value Formats](references/value_format.md): Named and custom currency/number formats.