User Guide Getting Started Help Center Documentation Community Training
New LookML
Old LookML
New LookML
Looker
  
English
日本語
datatype

Usage

view: view_name {
  dimension: order_date {
    datatype: date
  }
}

Hierarchy

datatype

Possible Field Types

Dimension, Dimension Group, Filter

Accepts

One of several possible values

Definition

The datatype parameter lets you specify the type of time data in your database table that you are supplying to your dimension, dimension_group, or filter field. Matching the data type to your field can increase query performance.

For dimensions and filters, and for dimension groups with type: time, the datatype parameter applies to the sql parameter of the dimension group

For dimension groups with type: duration, the datatype parameter applies to both the sql_start and sql_end parameters, so be sure the sql_start and sql_end are both of the specified data type.

The datatype parameter accepts the following values:

The default value for datatype is datetime.

Example

Create a dimension_group for a date field. Set the datatype: to date to increase query performance.

dimension_group: order_date type: time timeframes: [date, week, month, year] datatype: date sql: ${TABLE}.order_date

Top