Looker Guide

A practical guide to Looker development

View the Project on GitHub ashrithssreddy/looker-guide

🧰 Miscellaneous

1. Development Workflow

Looker’s typical development flow follows this sequence:

  1. βœ… Start in Production Mode
    β†’ You can see what the business sees
    β†’ But you can’t make dev changes yet

  2. πŸ”„ Switch to Development Mode
    β†’ A new Git branch is automatically created for you
    β†’ You’re now working in isolation

  3. 🧱 Create a View File
    β†’ Go to β€œDevelop” β†’ select your project
    β†’ Create a new view: users.view.lkml
    β†’ Define sql_table_name, at least one dimension

Example: view: users {
Β Β sql_table_name: analytics.users ;;
Β Β dimension: user_id { type: number sql: ${TABLE}.user_id ;; }
}

  1. πŸ“¦ Create/Modify a Model File
    β†’ If one doesn’t exist, create main.model.lkml
    β†’ Add include: "users.view.lkml"
    β†’ Add explore: users { from: users }
    β†’ Add the DB connection name

  2. πŸ§ͺ Validate LookML
    β†’ Use the Looker β€œValidate” button (top-right)
    β†’ Fix any syntax errors

  3. πŸ” Go to Explore
    β†’ Go to Explore β†’ select your model β†’ users
    β†’ You’ll now see your dimensions from users.view

  4. πŸ“Š Build Your First Tile
    β†’ Pick a field (e.g. user_id), select count
    β†’ Choose a chart type (e.g. bar or single value)
    β†’ Click β€œSave to Dashboard” β†’ New Dashboard β†’ Name it

  5. πŸ’Ύ Save + Commit
    β†’ Go back to Develop panel
    β†’ Commit the files (e.g., users.view.lkml, main.model.lkml)
    β†’ Push to Git

  6. πŸš€ Deploy to Production
    β†’ Deploy the branch from the Looker UI
    β†’ Tile + dashboard now available to all users

2. SQL Runner (Optional)

SQL Runner is a built-in query editor inside Looker β€” used for ad hoc SQL and quick table inspection.

πŸ’‘ What It Is

πŸ› οΈ When to Use It

⚑ Running Ad Hoc Queries

πŸ§ͺ Creating Temporary PDTs

πŸ“Œ Notes:

3. GitHub Repo in Looker

Looker uses real Git under the hood β€” each project links to a Git repo (GitHub, GitLab, Bitbucket, etc.) via the Looker UI. You commit + push from inside Looker’s Develop tab, and optionally deploy to production β€” all tracked in Git history.

πŸ“ Sample Git Repo Structure

looker_project/
β”œβ”€β”€ README.md
β”œβ”€β”€ .gitignore
β”œβ”€β”€ model/
β”‚   └── main.model.lkml
β”œβ”€β”€ views/
β”‚   β”œβ”€β”€ users.view.lkml
β”‚   β”œβ”€β”€ orders.view.lkml
β”‚   └── products.view.lkml
β”œβ”€β”€ dashboards/
β”‚   └── ecommerce.dashboard.lookml
β”œβ”€β”€ explores/
β”‚   └── ecommerce.explore.lkml
β”œβ”€β”€ sets/
β”‚   └── shared_fields.view.lkml
└── manifest.lkml

πŸ“Œ You interact with this repo inside Looker’s Develop panel, but it’s versioned and structured like any GitHub project.