Skip to main content

Basic Concepts

On this page, we will go through a few basic concepts that you will encounter throughout this document, give them a quick definition, and link to dedicated docs when necessary.

Expression

A “sentence” written in AQL code that, after being evaluated, will return something, like a table, a table column, or a scalar value.

For more details, please check out the Expressions page.

Model

An abstract layer on top of your physical database tables that is defined in a .model.aml file in the AML modeling layer. A model contains information about the source type (table, or query), its dimensions, measures, and other meta-data like model documents, owners…

For more details, please check out the AML Data Model page.

Iterate

In AQL, “iterate” on a table means going through all rows of that table, and apply the same operation on each row.

For example, in this transformation:

orders | select(quantity_times_10: orders.quantity * 10)

Behind the scenes, AQL goes through each row of the orders table, get the values of the quantity field, multiply it with 10, and assign the new values to a new field called quantity_times_10

Table’s origin model

In AQL, when you apply transformations on a Table or a Field (like select or filter), it outputs a new Table or a Field object that still retains information about the first model that you used.

For a more detailed explanation, please check out the Origin Model page.

Cross-model reference

This is one of the core features of AQL, that requires more reading to grasp. But in short, when you call select, filter, sum, or other functions that iterate on a Table with an origin model, you can reference other models that have relationships to that origin.

Context

Context encapsulates the necessary information to evaluate an expression, like the dimensions, relationships, and the filter condition that should be applied to the calculation…

For a more detailed explanation, please check out the Context page.

Types

Type can be understood as the “blueprint”, or the “category” of an object in AQL. Depending on its type, an object can have certain properties.

For more detailed explanation, please check out the Types page.


Let us know what you think about this document :)