View Parameters

LookML
Version

On this Page
Docs Menu

Go to Functional Reference for All Parameters

A “view” represents a table of data in Looker, whether that table is native to your database, or was created using Looker’s derived table functionality. Views are typically declared in view files, with one view per file.

Within each view are field definitions, which typically correspond to a column in the underlying table or a calculation in Looker. These fields are described in the field reference, dimension type reference, and measure type reference.

There are also a host of view level settings, which are described on this page.

Example Usage

# STRUCTURAL PARAMETERS - view: view_name   fields: - (dimension | dimension_group | measure | filter) # Possibly more dimension, dimension_group, measure, or filter declarations # (described on Field Parameters page)   sets: set_name: - field_or_set - field_or_set - … # Possibly more set declarations   # DISPLAY PARAMETERS label: 'desired label name'   # FILTER PARAMETERS suggestions: true | false   # QUERY PARAMETERS sql_table_name: table_name   # DERIVED TABLE PARAMETERS derived_table: datagroup_trigger: datagroup_name distribution: column_name distribution_style: ALL | EVEN indexes: [column_name, column_name, …] partition_keys: [column_name, column_name, …] persist_for: N (seconds | minutes | hours) sortkeys: [column_name, column_name, …] sql: SQL query sql_trigger_value: SQL query

Parameter Definitions

Parameter Name Description
Structural Parameters
fields (for view) Start a section of LookML to declare dimensions and measures
sets Define sets of dimensions and measures to be used in other parameters
view Create a view
Display Parameters
label Specify how the view name will appear in the Field Picker
Filter Parameters
suggestions (for view) Enable or disable suggestions for all dimensions on this view
Query Parameters
sql_table_name (for view) Change the SQL table on which a view is based
Derived Table Parameters
datagroup_trigger ADDED4.16 Specify the datagroup to use for the PDT rebuilding policy
derived_table Base a view on a derived table
distribution Set the distribution key of a persistent derived table that is built in Redshift or Aster
distribution_style Set the distribution style of a persistent derived table that is built in Redshift
indexes Set the indexes of a persistent derived table built in a traditional database (e.g. MySQL, Postgres) or an interleaved sort key in Redshift
partition_keys Specify that a field in a persistent derived table is based on a partitioned table column in BiqQuery or Presto
persist_for (for derived_table) Set the maximum age of a persistent derived table before it is regenerated
sortkeys Set the sort keys of a persistent derived table that is built in Redshift
sql (for derived_table) Declare the SQL query for a derived table
sql_trigger_value Specify the condition that causes a persistent derived table to be regenerated
Parameters to Avoid
view_label AVOID AS OF4.4 Specify how the view name will appear in the Field Picker. Use label instead.
distkey AVOID AS OF3.26 Set the distribution key of a persistent derived table that is built in Redshift
Still have questions?
Go to Discourse - or - Email Support
Top