View Parameters

LookML
Version

On this Page
Docs Menu

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

New Feature! Hover over the parameter names in the code example below to see quick descriptions, and click on parameter names to jump to that page.

When a parameter can be set to one of several specific options, the default value is listed first.

# STRUCTURAL PARAMETERS
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

  # DISPLAY PARAMETERS
  label: "View Label I Want"

  # FILTER PARAMETERS
  suggestions: yes | no

  # QUERY PARAMETERS
  sql_table_name: table_name ;;

  # DERIVED TABLE PARAMETERS
  derived_table: {
    distribution: "column_name"
    distribution_style: all | even
    indexes: ["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) OLD LOOKML Start a section of LookML to declare dimensions and measures
set NEW LOOKML Define a set of dimensions and measures to be used in other parameters
sets OLD LOOKML Define sets of dimensions and measures to be used in other parameters
view Create a view
Display Parameters
label Create a label for the view
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
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
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
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