Looker cookbook: Maximizing code reusability with DRY LookML
This cookbook contains a series of use cases (referred to in the Looker cookbooks as "recipes") for applying DRY (don't repeat yourself) principles to your LookML development, which can help you in the following areas:
- Reduce duplicated code: Make your projects more manageable and less error-prone by writing DRY LookML code that is easier to understand, modify, and maintain.
- Create reusable values and logic: Define values that can be used throughout your projects so that you only have to update them in one place if there is a change.
- Simplify complex logic: Break code down into smaller, reusable parts.
- Improve the organization and readability of your models and projects: Make code easier for other LookML developers to read, understand, and modify LookML.
Whether you are new to LookML or an experienced LookML developer, this cookbook provides you with recipes and techniques that will help you write clean and effective code now that will save you time and effort in the future.
Recipes and applications
All the examples in this cookbook are written for LookML developers and require permissions to develop LookML.
${TABLE}.name and use substitution operators (${view_name.field_name}) to refer to them in other parts of your code.
@{constant_name} syntax to reference the constant throughout your LookML project.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025年07月22日 UTC.