Model parameters

Model files define Explores and their relationships to other views.

In Looker, a model comprises a combination of related Explores and dashboards. Unlike other LookML elements, a model is not declared with a specific "model" parameter. Instead, any file placed in the Models section of the Looker IDE (also known as the Develop page) defines a model. The model name is taken from the filename and must be unique across your instance, even within different projects.

A model file typically contains any explore declarations, along with a number of model-level settings.

This page links to the model-level LookML parameters. They are typically written at the top of the model file and should not be nested within other parameters.

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

explore: explore_name {
  # Desired explore parameters (described on Explore Parameters page)
}
## Possibly more explore declarations

access_grant: access_grant_name{
  user_attribute: user_attribute_name
  allowed_values: ["value_1", "value_2", ...]
}
## Possibly more access_grant 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

## DISPLAY PARAMETERS
label: "desired label"

## FILTER PARAMETERS
case_sensitive: yes | no

## QUERY PARAMETERS
connection: "connection_name"
datagroup: datagroup_name{
  label: "desired label"
  description: "desired description"
  max_cache_age: "N (minutes | hours | days)"
  sql_trigger: SQL query ;;
}
## Possibly more datagroup declarations
fiscal_month_offset: N
persist_for: "N (seconds | minutes | hours)"
persist_with: datagroup_name
week_start_day: monday | tuesday | wednesday | thursday | friday | saturday | sunday

## VISUALIZATION AND FORMATTING PARAMETERS
map_layer: map_name{
  extents_json_url: "URL to JSON extents file"
  feature_key: "Name of TopoJSON object"
  file: "TopoJSON or GeoJSON filename" # or use the url subparameter
  format: topojson | vector_tile_region
  label: "desired label"
  max_zoom_level: number indicating max zoom
  min_zoom_level: number indicating min zoom
  projection: Preferred geographic projection
  property_key: "TopoJSON property"
  property_label_key: "Label for TopoJSON property"
  url: "URL that contains map file" # or use the file subparameter
}
## Possibly more map layer declarations

named_value_format: desired_name {
  value_format: "excel formatting string"
  strict_value_format: yes | no
 }
## Possibly more named value format declarations

Parameter definitions

Parameter Name Description
Structural Parameters
access_grant Creates an access grant that limits access of LookML structures to only those users who are assigned an approved user attribute value. This parameter has the user_attribute and allowed_values subparameters.
explore Exposes a view in the Explore menu. For more information about Explores and their parameters, see the Explore Parameter Reference page.
include Adds files to a model
test 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 the explore_source and assert subparameters.
Display Parameters
label (for model) Changes the way a model appears in the Explore menu
Filter Parameters
case_sensitive (for model) Specifies whether filters are case-sensitive for a model
Query Parameters
connection Changes the database connection for a model
datagroup Creates a datagroup-caching policy for a model. This parameter has the label, description, max_cache_age, and sql_trigger subparameters.
fiscal_month_offset Specifies the month your fiscal year begins (if it differs from the calendar year)
persist_for (for model) Changes the cache settings for a model
persist_with (for model) Specifies the datagroup to use for the model's caching policy
week_start_day Specifies the day of the week on which week-related dimensions should start
Visualization and Formatting Parameters
map_layer (for model) Creates custom maps to be used with map_layer_name
named_value_format Creates a custom value format to be used with value_format_name. This parameter has the value_format and strict_value_format subparameters.
Parameters to Avoid
scoping REMOVED 3.52 No longer required
template REMOVED 3.30 No longer required