Table Model
Knowledge Checkpoint
A grasp of these concepts will help you understand this documentation better:
Parameter definition
Parameter name | Description |
---|---|
import | Add files to a model |
models | Add models to be used in the querying |
type | Model type (whether it is Table model or SQL model) |
label | Specifies how the model will appear in the Ready-to-explore Dataset |
description | Add model description |
owner | Define who should be in charge of managing the current model |
table_name | Changes the SQL table on which a model is based |
data_source_name | Specify the database that Holistics will execute the generated query against (in the current model) |
dimension | Define a dimension. |
measure | Define a measure. |
Example Code
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}});;
}
}