Skip to main content

Table Model

Knowledge Checkpoint

A grasp of these concepts will help you understand this documentation better:

Introduction

Table Model defines a data model that sits on top of a SQL table.

Parameter definition

Parameter nameDescription
typeModel type: 'table' for Table Model, 'query' for Query Model
labelUser-friendly name for the model that appears in the Dataset exploration UI
descriptionDescription of the model. Support Markdown.
data_source_nameThe database on which Holistics will execute the SQL generated from this model
ownerDefine who should be in charge of managing the current model
table_namePath to the table underlying this model, in the form: '"schema_name"."table_name"'
dimensionDefine a dimension.
measureDefine a measure.

Code Example

Model users {
type: 'table'
label: "Users"
data_source_name: 'bigquery_dw'
table_name: 'users'

dimension id {
label: 'ID'
type: 'number'
hidden: false // optional
definition: @sql {{#SOURCE.id}};; // optional
}

dimension email {
label: 'Email'
type: 'number'
// without "definition", it automatically uses the same column name as the dimension name ('email')
}

measure user_count {
type: 'number'
label: 'Count Users'
definition: @sql count({{#SOURCE.id}});;
}
}

Let us know what you think about this document :)