lookml-liquid
Originally fromlkrdev/lookml_skills
Installation
SKILL.md
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