Basic Syntax
Literals and Values
MXL supports several literal types:| Type | Examples |
|---|---|
| Numbers | 42, 3.14, 100.5 |
| Strings | "USD", "capital" |
| Booleans | TRUE, FALSE |
| Null | NULL |
| Arrays | [1, 2, 3], ["USD", "EUR"], [] |
| Time Intervals | 1 day, 2 months, 3 quarters, 1 year |
Column References
Columns can be referenced in two ways:Column Access
Use bracket notation to select columns from a table:Variables
Context variables are accessed directly by name:Operators
Arithmetic Operators
| Operator | Description |
|---|---|
+ | Addition |
- | Subtraction |
* | Multiplication |
/ | Division |
^ | Power |
- (unary) | Negation |
Comparison Operators
| Operator | Description |
|---|---|
= | Equal |
<> | Not equal |
< | Less than |
<= | Less than or equal |
> | Greater than |
>= | Greater than or equal |
Logical Operators
| Operator | Description |
|---|---|
AND | Logical AND |
OR | Logical OR |
NOT | Logical NOT |
Operator Precedence
From highest to lowest:- Field access (
.,[]) - Negation (
-) - Exponentiation (
^) - Multiplication and Division (
*,/) - Addition and Subtraction (
+,-) - Comparison operators (
<,<=,>,>=,=,<>) - Logical NOT (
NOT) - Logical AND (
AND) - Logical OR (
OR)
(a + b) * c
Contexts
The Context of an MXL calculation signifies its functional purpose. It determines which tables, columns, and variables you can reference.Default Context
Tables:TransactionsBySecurityOwnershipTransactionsBySecurityOwnershipAndInvestmentTransaction
Waterfall Context
Tables:InvestmentAdjustedTransactionInvestmentAdjustedTransactionUngroupedWaterfallTierResultsInvestmentRealizationStatusVersion
distribution_date(DATE)hurdle_rate
Notice Context
Tables:Transaction
fund_family_sub_event_id(STRING)investor_entity_id(STRING)
Performance Metric Context
Tables:GLEntryTransaction
as_of_date(quarter-end date)
Credit Facility Context
Tables:CreditFacilityVersionTransactionsByBorrowingBaseGroupTransactionsBySecurityOwnership
total_unusedtotal_outstanding_amount_for_dayfacility_commitment_amount
Type System
Basic Types
| Type | Description |
|---|---|
Boolean | True/false values |
Integer | Whole numbers |
Decimal | Precise decimal numbers |
Float | Floating-point numbers |
String | Text values |
Date | Date values |
TimeDelta | Time intervals |
UUID | Unique identifiers |
ForeignKey | References to other tables |
NULL | Null/missing values |
Compound Types
Numeric- Union ofInteger | Decimal | FloatAny- Any type (used where type doesn’t matter, like COUNT)T- Generic type variable (used in IF and COALESCE)
Type Notation
Column[Type]- A column containing values of the specified typeType- A scalar/literal value[Type, ...]- An array of valuesTable- A table/range reference
Display Types
Display types control how calculation results are formatted in the UI:| Type | Example | Description |
|---|---|---|
| Decimal | 1234.56 | Number with fractional precision |
| Integer | 42 | Whole number |
| Money | $129.99 | Currency value |
| Percent | 22.4% | Percentage value |
| Multiple | 1.68x | Numeric multiplier |
| Date | 2025-10-23 | Calendar date |
| Datetime | 2025-10-23T14:30:00Z | Full timestamp |
| Time Delta | 10 days | Number of days |
| Text | Port Co X | Plain text |
| Boolean | TRUE | Logical value |
Functions Reference
Arithmetic Functions
ADD / SUB / MULT / DIV / POW
Aggregation Functions
SUM
MIN / MAX
AVG
Decimal for precision.
COUNT
GEO_MEAN
Comparison Functions
LEAST / GREATEST
COALESCE
Conditional Functions
IF
IN
EXISTS
Date Functions
DATE
DATE_TRUNC
"day", "week", "month", "quarter", "year", "decade", "century", "millennium"
DAY / MONTH / YEAR
DAYS
Table Operations
FILTER
GROUP_BY
WINDOW
LOOKUP
STACK
Financial Functions
FV (Future Value)
amount * ((1 + rate)^period - 1)
Example: