lookml-liquid
Instructions
- Syntax:
{{ value }}: Output syntax (inserts text).{% if condition %}: Tag syntax (logic).
- Common Variables:
value: Raw value from DB (best for comparisons).rendered_value: Formatted value (best for display)._filters['view.field']: User-selected filter values.parameter_name._parameter_value: Selected parameter value.
- Best Practices:
- SQL Injection: Always use
| sql_quotewhen inserting user input (like_filters) into SQL that generates string literals. - Booleans: If your dialect requires literal
TRUE/FALSE(like BigQuery), append| sql_booleanto_in_queryor_is_selectedvariables (e.g.,{{ view.field._in_query | sql_boolean }}). - Dependency Awareness: Remember that
_in_querychecks for usage in SELECT, Filters, andrequired_fields. It is NOT limited to just the visible columns. - Performance: Avoid referencing
{{ field._value }}inlinkparameters if the field isn't already in the query, as this forces Looker to add the field to theGROUP BYclause, potentially fan-outing the result set. Userow['view.field']instead if you only need the value from the browser result row.
- SQL Injection: Always use
Advanced Variable Usage
_in_query vs _is_selected
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-model
Use this skill when you need to create or modify a LookML Model file (.model.lkml). This includes defining connections, includes, and configuring model-level settings.
24lookml-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.
21