User Guide Getting Started Help Center Documentation Community Training
New LookML
Old LookML
New LookML
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, 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

Hover over a parameter name to see a quick description; click it to jump to that page.
When a parameter can be set to one of several specific options, the default value is listed first.

view: 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

  label: "View Label I Want"

  suggestions: yes | no

  sql_table_name: table_name ;;

  derived_table: {
    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)
    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_create: {
      SQL query ;;
    sql_trigger_value: SQL query ;;

Parameter Definitions

Parameter Name Description
Structural Parameters
set Define a set 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
create_process ADDED5.16 Specify 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.
datagroup_trigger 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
explore_source Define a native derived table based on an Explore. This parameter has the following subparameters:
  • bind_filters (with its own subparameters from_field, and to_field)
  • column (with its own subparameter field)
  • derived_column (with its own subparameter sql)
  • expression_custom_filter
  • filters (with its own subparameters field and value)
  • limit
  • sort (with its own subparameters desc and field)
  • timezone
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 ADDED5.10 Specify that a persistent derived table be partitioned by one or more fields in Presto, or by a single date/time field in BigQuery
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_create ADDED5.16 Define a SQL CREATE statement to create a PDT on a database dialect that requires custom DDL commands
sql_trigger_value Specify the condition that causes a persistent derived table to be regenerated
Parameters to Avoid
view_label AVOID4.4 Replaced by label
distkey REMOVED3.26 Replaced by distribution