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 ontestpage) } 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 onexplore_sourcepage) } 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
explore_source
and assert
subparameters.yes
, hides all fields in the view by default. Use the hidden: no
parameter on a field to display the field.cluster_keys
on Snowflakesql_step
.increment_key
specifies the time increment for which fresh data should be queried and appended to the PDT.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.interval_trigger
specifies a rebuild schedule for a persistent derived table, in the format "N (seconds | minutes | hours)"
materialized_view: yes
creates a materialized view on your database for a derived table.publish_as_db_view: yes
creates a stable database view for the PDT to enable querying the table outside of LookerSQL CREATE
statement to create a PDT on a database dialect that requires custom DDL commands+
) 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.
