Skip to main content

AML Model

Introduction

A Model in AML represents either a database table or a SQL query, and contains dimensions and measures that define how data can be explored and aggregated. Models are declared in .model.aml files (one model per file).

Model types

AML supports two types of models:

Common parameters

These parameters are shared by both Table Models and Query Models:

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
dimensionDefine a dimension. See Model Fields
measureDefine a measure. See Model Fields

Basic syntax

Model model_name {
type: 'table' // or 'query'
label: "Model Label"
description: "Model description here"
data_source_name: 'your_datasource_name'

dimension dimension_name {
label: 'Dimension Label'
type: 'text'
definition: @sql {{ #SOURCE.column_name }};;
}

measure measure_name {
label: 'Measure Label'
type: 'number'
definition: @aql count(model_name.dimension_name) ;;
}
}

See also


Open Markdown
Let us know what you think about this document :)