looker-open-source/looker-skills

lookml-view

Use this skill to create or modify LookML Views. Covers basic view definitions, sql_table_name, file organization, and patterns.

First seen Jun 9, 2026

Installation

$ npx skills add looker-open-source/looker-skills --skill lookml-view

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 looker-open-source/looker-skills · top by installs.

npx skills add looker-open-source/looker-skills

Browse all from looker-open-source/looker-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 26
License LICENSE
Default branch main
Open issues 0
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

Versionv1
LicenseApache-2.0
More metadata
publisher
google
version
v1

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,262 B
  • docs SUMMARY.md 147 B

History

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

SKILL.md

Instructions

1. File Organization

  • Standard Views: views/[datasourcename]/[viewname].view.lkml
  • Extended Views: views/[datasourcename]/[viewname]_ext.view.lkml
  • Refinements: views/[datasourcename]/[viewname]_rfn.view.lkml
  • NDTs: views/[datasourcename]/[viewname]_ndt.view.lkml
  • SDTs: views/[datasourcename]/[viewname]_sdt.view.lkml

2. Core Standards

  1. sqltablename: Required for standard views. Defaults are fragile; be explicit.
  2. Primary Key:

- Convention: place the primary key as the first dimension for readability. - Must have primary_key: yesWhy: essential for symmetric aggregates, which Looker uses to handle JOIN row duplication correctly (prevents fanout in multi-join queries).

  1. Refinements: Use + before the view name (e.g., view: +users) to refine existing views without modifying the original file.
  2. Extensions: Use extends to reuse logic from other views.
  3. Derived Tables: Evaluate and nudge towards Native Derived Tables (NDTs) (exploresource) over SQL Derived Tables (sql) where possible. When creating entity rollups or summary facts (e.g., userorder_facts), assess whether an existing Explore can source the data. NDTs are recommended because they minimize code drift and automatically inherit underlying LookML descriptions, formatting, and Row-Level Security (RLS). If an NDT is too complex, or if specific SQL features are required, an SDT is fully acceptable.

3. Best Practices

  • Naming: Use snake_case for view names and filenames.
  • Descriptions: Add descriptions to the view itself if it helps explain its purpose (e.g., "Daily active users aggregated by region").
  • Output Format: Ensure the file ends with a newline.

4. Related Skills

  • [lookml-refinements](../lookml-refinements/SKILL.md): Logic for include, refinements (+), and Hub & Spoke patterns.

Examples

Basic View

view: users {
  sql_table_name: `project.dataset.users` ;;

  dimension: user_id {
    primary_key: yes
    type: number
    sql: ${TABLE}.id ;;
    group_label: "IDs"
    description: "Unique internal user ID."
  }

  dimension: email {
    type: string
    sql: ${TABLE}.email ;;
    description: "User's email address."
  }
}

Extended View

include: "/views/base/users.view"

view: users_extended {
  extends: [users]

  dimension: lifetime_value {
    type: number
    sql: ${TABLE}.ltv ;;
    description: "Total lifetime value of the user."
  }
}

Refinement (Layering)

include: "/views/users.view"

view: +users {
  label: "All Users (Refined)"
  
  dimension: email {
    # Adding a description to an existing field
    description: "Primary contact email."
  }
}

Reference Skills

  • [Derived Tables](references/derived_table.md): Standard (SDT) and Native (NDT) derived table patterns/materialization.