View 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, each of which typically corresponds 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 number of view-level settings, which are described on this page.

Example usage

Hover over a parameter name to see a quick description. Click a parameter to visit its reference page. When a parameter can be set to one of several specific options, the default value is listed first.

## STRUCTURAL PARAMETERS  include 
 
 : 
 "filename_or_pattern" 
## Possibly more include declarations  test 
 
 : 
 test_name 
 { 
  explore_source 
 
 : 
 explore_name 
 { 
    # Desired subparameters (described on  test 
 
page)
   } 
  assert 
 
 : 
 assert_statement 
 { 
  expression 
 
 : 
 Looker expression 
 ;; 
 } 
  # Possibly more assert declarations } 
## Possibly more test declarations  view 
 
 : 
 view_name 
 { 
  extension 
 
 : 
 required 
  extends 
 
 : 
 [ 
 view_name 
 , 
 view_name 
 , 
... ] 
 ( 
  dimension 
 
|  dimension_group 
 
|  measure 
 
|  filter 
 
 ) 
 : 
 field_name 
 { 
    # Desired field parameters (described on Field Parameters 
page)
   } 
  # Possibly more field declarations

    set 
 
 : 
 set_name 
 { 
  fields: 
 
 [ 
 field_or_set 
 , 
 field_or_set 
 , 
... ] 
 } 
  # Possibly more set declarations

    drill_fields 
 
 : 
 [ 
 field_or_set 
 , 
 field_or_set 
 , 
... ] 
  # DISPLAY PARAMETERS

    label 
 
 : 
 "desired label" 
  fields_hidden_by_default 
 
 : 
 yes 
| no 
  # FILTER PARAMETERS

    suggestions 
 
 : 
 yes 
| no 
  # QUERY PARAMETERS

    required_access_grants 
 
 : [ 
 access_grant_name 
 , 
 access_grant_name 
 , ...] 
  sql_table_name 
 
 : 
 table_name 
 ;; 
  # DERIVED TABLE PARAMETERS

    derived_table 
 
 : 
 { 
  cluster_keys 
 
 : 
 [ 
 "column_name" 
 , 
 "column_name" 
 , 
... ] 
  create_process 
 
 : { 
  sql_step 
 
 : 
 SQL query 
 ;; 
 } 
  datagroup_trigger 
 
 : 
 datagroup_name 
  distribution 
 
 : 
 "column_name" 
  distribution_style 
 
 : 
 all 
| even 
  explore_source 
 
 : 
 explore_name 
 { 
      # Desired subparameters (described on  explore_source 
 
page)
     } 
  increment_key 
 
 : 
 "column_name" 
  increment_offset 
 
 : N 
  indexes 
 
 : 
 [ 
 "column_name" 
 , 
 "column_name" 
 , 
... ] 
  interval_trigger 
 
 : "N (seconds | minutes | hours)" 
  materialized_view 
 
 : 
 yes 
| no 
  partition_keys 
 
 : 
 [ 
 "column_name" 
 , 
 "column_name" 
 , 
... ] 
  persist_for 
 
 : 
 "N (seconds | minutes | hours)" 
  publish_as_db_view 
 
 : 
 yes 
| no 
  sortkeys 
 
 : 
 [ 
 "column_name" 
 , 
 "column_name" 
 , 
... ] 
  sql 
 
 : 
 SQL query 
 ;; 
  sql_create 
 
 : { 
 SQL query 
 ;; 
 } 
  sql_trigger_value 
 
 : 
 SQL query 
 ;; 
  table_compression 
 
 : 
 GZIP 
| SNAPPY 
  table_format 
 
 : 
 PARQUET 
| ORC 
| AVRO 
| JSON 
| TEXTFILE 
 } 
 } 
## REFINEMENT PARAMETERS view 
 : 
  + 
 view_name 
 
 { 
  final 
 
 : 
 yes 
 } 
 
 

Parameter definitions

Parameter Name
Description
Structural Parameters
Specifies the default list of fields shown when drilling into measures defined in the view
Specifies view(s) that will be extended by this view
Specifies that the view requires extension and cannot itself be exposed to users
Adds files to a view
Creates a data test to verify your model's logic. The project settings include an option to require data tests . When this is enabled for a project, developers on the project must run data tests before deploying their changes to production. This parameter has explore_source and assert subparameters.
Defines a set of dimensions and measures to be used in other parameters
Creates a view
Display Parameters
Specifies how the view name will appear in the field picker
Added 21.12 When set to yes , hides all fields in the view by default. Use the hidden: no parameter on a field to display the field.
Filter Parameters
Enables or disables suggestions for all dimensions on this view
Query Parameters
Limits access to the view to only users whose user attribute values match the access grants
Changes the SQL table on which a view is based
Derived Table Parameters
Specifies that a PDT be clustered by one or more fields in BigQuerySupport added for cluster_keys on Snowflake
Specifies an ordered sequence of steps to create a PDT on a database dialect that requires custom DDL commands. This parameter has the subparameter sql_step .
Specifies the datagroup to use for the PDT rebuilding policy
Bases a view on a derived table
Sets the distribution key of a PDT that is built in Redshift or Aster
Sets the distribution style of a PDT that is built in Redshift
Defines a native derived table based on an Explore
Added 21.4 Makes the derived table into an incremental PDT . The increment_key specifies the time increment for which fresh data should be queried and appended to the PDT.
Added 21.4 Used in conjunction with the increment_key parameter for incremental PDTs. The increment_offset specifies the number of previous time periods (at the increment key's granularity) that are rebuilt to account for late arriving data.
Added 21.20 The interval_trigger specifies a rebuild schedule for a persistent derived table, in the format "N (seconds | minutes | hours)"
Added 21.10 The statement materialized_view: yes creates a materialized view on your database for a derived table.
Sets the indexes of a PDT built in a traditional database (for example, MySQL, Postgres) or an interleaved sort key in Redshift
Specifies that a PDT be partitioned by one or more fields in Presto, or by a single date/time field in BigQuery
Sets the maximum age of a PDT before it is regenerated
The statement publish_as_db_view: yes creates a stable database view for the PDT to enable querying the table outside of Looker
Sets the sort keys of a PDT that is built in Redshift
Declares the SQL query for a derived table
Defines a SQL CREATE statement to create a PDT on a database dialect that requires custom DDL commands
Specifies the condition that causes a PDT to be regenerated
Specifies the table compression to use for a PDT in Amazon Athena
Specifies the table format to use for a PDT in Amazon Athena
Refinement Parameters
Adds a plus sign ( + ) in front of an existing view name to add a refinement to the existing view. See the LookML refinements documentation page for more information and use cases.
Indicates that the current refinement is the final refinement allowed for the view. See the LookML refinements documentation page for more information and use cases.
Parameters to Avoid
Removed 3.26 Replaced by distribution
Avoid 4.4 Replaced by label
Design a Mobile Site
View Site in Mobile | Classic
Share by: