lookml-model
Instructions
- Define the Model File: A model file generally corresponds to a single database connection and includes Explores.
- Required Parameters:
connection: "connection_name": Must match a connection defined in Looker Admin.include: "pattern": Specifies which view and dashboard files are available to the model.
- Best Practices:
- Includes: Avoid
include: "*.view"if possible to prevent performance issues and namespace clutter. Use specific paths or wildcards likeinclude: "/views/users.view"orinclude: "/views/marketing/*.view". - Label: Use
label:to provide a user-friendly name for the model in the UI. - Week Start Day: Set
week_start_day:if the business logic requires a specific start day (e.g.,monday). - Datagroups & Caching: ALWAYS use datagroups for caching policies to align Looker with your ETL/ELT processes.
- Includes: Avoid
4. Datagroups & Caching
Datagroups are the preferred mechanism for managing caching policies.
- Definition: Define in the model file.
- sql_trigger: A query that returns a single value (e.g., max timestamp). If the value changes, the cache is invalidated.
- max_cache_age: A fallback duration if the trigger doesn't change.
More from lkrdev/lookml_skills
lookml-view
Use this skill to create or modify LookML Views. Covers basic view definitions, sql_table_name, file organization, and patterns.
25lookml-explore
Use this skill when you need to create or modify a LookML Explore. This includes defining the Explore, joins, access grants, and basic configuration.
23lookml-refinements
Deep dive into LookML includes, refinements (layering), and project structure best practices. Essential for mastering Looker's object-oriented capabilities.
23lookml-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.
22lookml-sets
Guide to using LookML sets for grouping fields, controlling visibility, and managing drill paths.
21lookml-liquid
Use this skill to use Liquid variables in LookML for dynamic SQL, HTML, and Links, including advanced patterns for query optimization.
21