Field Parameters

LookML
Version

On this Page
Docs Menu

This page links to all of the LookML parameters that define fields.

There are several types of fields:

  • Dimensions represent a column in a table, or a computed value based on some sort of column manipulation or combination
  • Dimension Groups are only used with time-based data, and enable you to create many time-based dimensions at one time
  • Measures are similar to aggregate functions in SQL (e.g. COUNT, SUM, AVG) and represent information about multiple rows
  • Filters create a filter-only field users can use to provide input to a templated filter

Example Usage

- (dimension | dimension_group | measure | filter): field_name   # SHARED PARAMETERS label: 'desired label name' view_label: 'desired label name' group_label: 'desired label name' description: 'description string' hidden: true | false alias: [old_field_name, old_field_name, …] value_format: 'excel-style formatting string' value_format_name: format_name html: HTML expression using Liquid template elements sql: SQL expression to generate the field value required_fields: [field_name, field_name, …] drill_fields: [field_or_set, field_or_set, …] can_filter: true | false fanout_on: repeated_record_name   # DIMENSION SPECIFIC PARAMETERS type: dimension_field_type primary_key: true | false sql_case: value: SQL condition value: SQL condition # Possibly more sql_case statements alpha_sort: true | false tiers: [N, N, …] style: classic | interval | integer | relational sql_latitude: SQL expression to generate a latitude sql_longitude: SQL expression to generate a longitude suggestable: true | false suggest_persist_for: N (seconds | minutes | hours) suggest_dimension: dimension_name suggest_explore: explore_name suggestions: ['suggestion string', 'suggestion string', …] bypass_suggest_restrictions: true | false full_suggestions: true | false skip_drill_filter: true | false case_sensitive: true | false order_by_field: dimension_name map_layer: name_of_map_layer links: - label: 'desired label name' url: desired_url icon_url: url_of_an_ico_file # Possibly more links   # DIMENSION GROUP SPECIFIC PARAMETERS timeframes: [timeframe, timeframe, …] convert_tz: true | false datatype: epoch | timestamp | datetime | date | yyyymmdd   # MEASURE SPECIFIC PARAMETERS type: measure_field_type direction: row | column approximate: true | false approximate_threshold: N sql_distinct_key: SQL expression to define repeated entities list_field: dimension_name filters: dimension_name: 'looker filter expression' # Possibly more filters statements   # FILTER SPECIFIC PARAMETERS default_value: 'desired default value'   # Possibly more dimension or measure declarations
(dimension | dimension_group | measure | filter): field_name {   # SHARED PARAMETERS label: "desired label name" view_label: "desired label name" group_label: "desired label name" description: "description string" hidden: yes | no alias: [old_field_name, old_field_name, …] value_format: "excel-style formatting string" value_format_name: format_name html: HTML expression using Liquid template elements ;; sql: SQL expression to generate the field value ;; required_fields: [field_name, field_name, …] drill_fields: [field_or_set, field_or_set, …] can_filter: yes | no fanout_on: repeated_record_name action: { label: "desired label name" url: "url" icon_url: "url" form_url: "url" param: { name: "name string" value: "value string" } # Possibly more param definitions form_param: { name: "name string" type: select | string | textarea label: "desired label name" required: yes | no default: "value string" option: { name: "name string" value: "value string" } # More option definitions } # Possibly more form_param definitions }   # DIMENSION SPECIFIC PARAMETERS type: dimension_field_type primary_key: yes | no case: { when: { sql: SQL condition ;; label: "value" } # Possibly more when statements }   alpha_sort: yes | no tiers: [N, N, …] style: classic | interval | integer | relational sql_latitude: SQL expression to generate a latitude ;; sql_longitude: SQL expression to generate a longitude ;; suggestable: yes | no suggest_persist_for: "N (seconds | minutes | hours)" suggest_dimension: dimension_name suggest_explore: explore_name suggestions: ["suggestion string", "suggestion string", "…"] bypass_suggest_restrictions: yes | no full_suggestions: yes | no skip_drill_filter: yes | no case_sensitive: yes | no order_by_field: dimension_name map_layer_name: name_of_map_layer   link: { label: "desired label name;" url: "desired_url" icon_url: "url_of_an_ico_file" } # Possibly more links   # DIMENSION GROUP SPECIFIC PARAMETERS timeframes: [timeframe, timeframe, …] convert_tz: yes | no datatype: epoch | timestamp | datetime | date | yyyymmdd   # MEASURE SPECIFIC PARAMETERS type: measure_field_type direction: "row | column" approximate: yes | no approximate_threshold: N sql_distinct_key: SQL expression to define repeated entities ;; list_field: dimension_name   filters: { field: dimension_name value: "looker filter expression" } # Possibly more filters statements   # FILTER SPECIFIC PARAMETERS default_value: "desired default value" } # Possibly more dimension or measure declarations

Parameter Definitions

Parameter Name Description
dimension Create a dimension field
dimension_group Create several time-based dimensions at the same time
measure Create a measure field
filter Create a filter-only field for use in a templated filter
label (for dimension and measure) Change a way the field name appears in the field picker
view_label (for dimension and measure) Change the way a view name appears, or the fields that appear within a view, in the field picker
group_label (for dimension and measure) ADDED3.44 Group fields together within a view in the field picker
description (for dimension and measure) Add a description to the field users can see on hover
hidden (for dimension and measure) Hide a field from the Explore UI
alias Allow saved URLs with old field names to remain functional after re-naming a field
value_format Format the output of a field using Excel style options
value_format_name ADDED3.38 Format the output of a field using a built-in or custom format
html Modify the HTML output of a field using liquid templating
sql Determine how the field will be calculated
required_fields Require that additional fields are added to a query when a field is chosen
drill_fields Declare the list of fields that will be displayed when the measure or dimension is drilled into
can_filter ADDED3.48 Determine if a dimension or measure can be used as a filter
fanout_on Enable access to Google BigQuery repeated fields
action ADDED4.0 Creates a data action on a field that let’s users perform tasks in other tools, directly from Looker
Dimension Specific Parameters
type (for dimension or filter) Specify the type of the dimension or filter
primary_key Declare a dimension as the primary key of a view
sql_case OLD LOOKML Create a discrete set of values a dimension can have determined by SQL conditions
case NEW LOOKML Create a discrete set of values a dimension can have determined by SQL conditions
alpha_sort (for Old LookML) OLD LOOKML Make a sql_case sort its conditions alphabetically
alpha_sort (for New LookML) NEW LOOKML Make a case parameter sort its conditions alphabetically
tiers Define the tiers for a type: tier dimension
style Change the way that tiers appear in the Looker UI for a type: tier dimension
sql_latitude Define the latitude of a type: location dimension
sql_longitude Define the longitude of a type: location dimension
suggestable Enable or disable suggestions for a dimension
suggest_persist_for Change the cache settings for Looker filter suggestions
suggest_dimension Base the suggestions for a dimension on the values of a different dimension
suggest_explore Base the suggestions for a dimension on the values of a different explore
suggestions Declare a list of values that will be used for a dimension’s suggestions
bypass_suggest_restrictions Show suggestions to users when sql_always_where or access_filter_fields is in use, but don’t apply those limits to the suggestions
full_suggestions Show suggestions to users when sql_always_where or access_filter_fields is in use, and do apply those limits to the suggestions
skip_drill_filter Stop a dimension from being added to the filters when a measure is drilled into
case_sensitive (for dimension) Determine if filters are case sensitive for a dimension
order_by_field Sort a dimension by the values of another dimension
link NEW LOOKML Specifies a valid URL to redirect and insert dimension value into upon clicking
map_layer OLD LOOKML Specifies a mapping from a data value to a geographic region that you’ve defined on a built-in or custom map
map_layer_name NEW LOOKML Specifies a mapping from a data value to a geographic region that you’ve defined on a built-in or custom map
links ADDED3.40 OLD LOOKML Specifies a valid URL to redirect and insert dimension value into upon clicking
Dimension Group Specific Parameters
type (for dimension group) For dimension groups, the type is always set to time
timeframes Define the set of timeframe dimensions you want a dimension_group to produce
convert_tz Disable automatic timezone conversion for a dimension_group
datatype Specify the type of time data you are providing to a dimension_group
Measure Specific Parameters
type (for measure) Specify the type of measure
direction Determine the direction that type: percent_of_total or type: running_total measures are calculated when pivots are used
approximate Perform an approximate count for type: count_distinct measures, for Redshift or BigQuery
approximate_threshold Set the count at which BigQuery switches from an exact count distinct to an approximate count distinct
sql_distinct_key Define the unique entities over which a type: sum_distinct or type: average_distinct measure will be calculated
list_field Declare the dimension from which a type: list measure will be calculated
filters (for measure) Restrict a measure’s calculation based on dimension limitations
Filter Specific Parameters
default_value Specifies a default value for filter fields
Parameters to Avoid
decimals AVOID AS OF3.38 Replaced by value_format
format AVOID AS OF3.16 Replaced by value_format
Still have questions?
Go to Discourse - or - Email Support
Top