Skip to main content

View

View Syntax

name.view.aml
#Defining the new view
view: view_name {
sql_table_name: table_name ;;
label: View Name
hidden: yes | no

derived_table: {...}

join: join_name {...}

dimension: dimension_name {...}

dimension_group: group_name {...}

dimension_provider: provider_name {...}

measure: measure_name {...}

drill_fields: [field1, field2, ....]
}

#extending existing view
view: +view_name {...}

View Syntax Example

orders.view.aml
view: orders {
sql_table_name: orders_grid ;;

dimension: id {
primary_key: yes
type: number
hidden: yes
}

dimension: name {
type: string
}

dimension: customer_name {
type: string
sql: CONCAT(${TABLE}.firstname, ${TABLE}.lastname} ;;
}

dimension: amount {
type: number
}

measure: total_amount {
type: sum
sql: ${amount} ;;
}

measure: count {
type: count
label: Number of orders
}
}