ChartMogul Filter Language
Learn how to use the ChartMogul Filter Language (CFL) to filter data programmatically.
The ChartMogul Filter Language (CFL) is a string-based syntax for filtering data.
CFL allows you to programmatically apply the same filters that you use in the ChartMogul interface. When you apply filters in the app, the resulting CFL string appears in your browser’s address bar.
Metrics API endpoints accept an optional filters parameter that uses CFL to define filter criteria.
Syntax
CFL has the following format:
[filter]~[operator]~[value]~AND~[filter]~[operator]~[value]~AND~…
Key rules
- Separators: Use
~(tilde) characters to separate filters, operators and values. - Operators: Join multiple filters with
~AND~. CFL only supports the AND operator (all conditions must match). - String format: Enclose string values in single quotes, e.g.,
'US','Enterprise'. - Multiple values: Separate multiple values with commas, e.g.,
'US','FR','DE'.
Special case: plan filters
Plan and plan group filters have a unique behavior: when connected with the AND operator, they function as an OR condition. This behavior reflects how the filters work in the app.
Let’s take the following expression as an example:
plan~ANY~<PLAN_UUID>~AND~plan_group~ANY~<PLAN_GROUP_UUID>
Even though the filters are connected with the AND operator, a plan must match either the plan UUID OR the plan group UUID.
Operators
CFL uses the following operators:
Set operators
ALL— Matches only if the record contains all of the specified values.ANY— Matches if the record contains any of the specified values.NONE— Matches if the record contains none of the specified values.
Comparison operators
EQ— Equal to; matches if the value equals the specified value.NOT_EQ— Not equal to; matches if the value does not equal the specified value.GT— Greater than; matches if the value is greater than the specified value.GTE— Greater than or equal to; matches if the value is greater than or equal to the specified value.LT— Less than; matches if the value is less than the specified value.LTE— Less than or equal to; matches if the value is less than or equal to the specified value.IS_NULL_OR_EQ— Matches if the value isNULLor equals the specified value.
Range operators
BETWEEN— Specifies a range with two comma-separated values.
Containment operators
CONTAINS— Matches if the string contains the specified value.NOT_CONTAINS— Matches if the string does not contain the specified value.
Identity operators
IS— Checks if the value matches the specified value.IS_NOT— Checks if the value does not match the specified value.
Review operators available for each filter.
Getting CFL from the app
The easiest way to construct a valid CFL string is to obtain it from the app:
- Navigate to Reports in ChartMogul.
- Apply your desired filters.
- Copy the
filtersparameter value from the browser address bar.
Using CFL in API requests
Use CFL as the value of the optional filters parameter when calling Metrics API endpoints. The parameter is only available for cURL calls.
Either use URL-encoded CFL copied from the address bar:
curl -X GET "https://api.chartmogul.com/v1/metrics/arr" \
-u YOUR_API_KEY: \
-d start-date=2025-01-01 \
-d end-date=2025-03-31 \
-d interval=month \
-d filters=region~ANY~%27US%27%2C%27FR%27%2C%27DE%27~AND~mrr~GT~150
Or write CFL manually (requires double quotes around the key-value pair):
curl -X GET "https://api.chartmogul.com/v1/metrics/arr" \
-u YOUR_API_KEY: \
-d start-date=2025-01-01 \
-d end-date=2025-03-31 \
-d interval=month \
-d "filters=region~ANY~'US','FR','DE'~AND~mrr~GT~150"
Available filters
The following table lists filters that can be used in CFL expressions, along with supported operators and example values. Click a filter to open a page with its detailed description.
Review our comprehensive resource on ChartMogul filters and their behaviors.
| Filter | Operators | Values |
|---|---|---|
| active_ |
BETWEEN |
Two comma-separated integers, e.g., 0,11 |
LT, LTE, EQ, NOT_EQ, GTE, GT |
An integer, e.g., 3 |
|
| active_ |
BETWEEN |
Two comma-separated integers, e.g., 0,11 |
LT, LTE, EQ, NOT_EQ, GTE, GT |
An integer, e.g., 3 |
|
| average_ |
BETWEEN |
Two comma-separated integers or floats, e.g., 0,10.14 |
LT, LTE, EQ, NOT_EQ, GTE, GT |
An integer or float, e.g., 10.14 |
|
| churned_ |
BETWEEN |
Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01 |
LT, LTE, EQ, GTE, GT, IS, IS_NOT |
An ISO 8601 date, e.g., 2025-12-06 or NULL |
|
| churning_ |
BETWEEN |
Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01 |
LT, LTE, EQ, GTE, GT, IS, IS_NOT |
An ISO 8601 date, e.g., 2025-12-06 or NULL |
|
| contacts_count | BETWEEN |
Two comma-separated integers, e.g., 0,11 |
LT, LTE, EQ, NOT_EQ, GTE, GT |
An integer, e.g., 3 |
|
| contracted_ |
BETWEEN |
Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01 |
LT, LTE, EQ, GTE, GT, IS, IS_NOT |
An ISO 8601 date, e.g., 2025-12-06 or NULL |
|
| currency | ALL, ANY, NONE |
Comma-separated, single-quoted ISO 4217 currency codes, e.g., 'EUR','USD' |
| customer_ |
BETWEEN |
Two comma-separated integers, e.g., 0,11 |
LT, LTE, EQ, NOT_EQ, GTE, GT |
An integer, e.g., 3 |
|
| customer | ALL, ANY, NONE |
Comma-separated customer UUIDs, e.g., cus_ |
| customer_ |
BETWEEN |
Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01 |
LT, LTE, EQ, GTE, GT, IS, IS_NOT |
An ISO 8601 date, e.g., 2025-12-06 or NULL |
|
| customer_ |
ANY, NONE |
Comma-separated, single-quoted strings with customer status values: new_, working_, qualified_, unqualified_, active, past_ or cancelled, e.g., 'past_due','cancelled' |
| data_ |
ALL, ANY, NONE |
Comma-separated source UUIDs, e.g., ds_ |
| due_at | BETWEEN |
Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01 |
LT, LTE, EQ, GTE, GT, IS, IS_NOT |
An ISO 8601 date, e.g., 2025-12-06 or NULL |
|
| expanded_on | BETWEEN |
Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01 |
LT, LTE, EQ, GTE, GT, IS, IS_NOT |
An ISO 8601 date, e.g., 2025-12-06 or NULL |
|
| free_ |
BETWEEN |
Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01 |
LT, LTE, EQ, GTE, GT, IS, IS_NOT |
An ISO 8601 date, e.g., 2025-12-06 or NULL |
|
| has_ |
EQ |
TRUE or FALSE |
| has_ |
EQ |
TRUE or FALSE |
| has_ |
EQ |
TRUE or FALSE |
| last_ |
BETWEEN |
Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01 |
LT, LTE, EQ, GTE, GT, IS, IS_NOT |
An ISO 8601 date, e.g., 2025-12-06 or NULL |
|
| last_ |
BETWEEN |
Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01 |
LT, LTE, EQ, GTE, GT, IS, IS_NOT |
An ISO 8601 date, e.g., 2025-12-06 or NULL |
|
| last_ |
BETWEEN |
Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01 |
LT, LTE, EQ, GTE, GT, IS, IS_NOT |
An ISO 8601 date, e.g., 2025-12-06 or NULL |
|
| last_ |
BETWEEN |
Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01 |
LT, LTE, EQ, GTE, GT, IS, IS_NOT |
An ISO 8601 date, e.g., 2025-12-06 or NULL |
|
| last_ |
BETWEEN |
Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01 |
LT, LTE, EQ, GTE, GT, IS, IS_NOT |
An ISO 8601 date, e.g., 2025-12-06 or NULL |
|
| lead_ |
BETWEEN |
Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01 |
LT, LTE, EQ, GTE, GT, IS, IS_NOT |
An ISO 8601 date, e.g., 2025-12-06 or NULL |
|
| mrr_ |
BETWEEN |
Two comma-separated integers or floats, e.g., 0,10.14 |
LT, LTE, EQ, NOT_EQ, GTE, GT |
An integer or float, e.g., 10.14 |
|
| mrr_ |
BETWEEN |
Two comma-separated integers or floats, e.g., 0,10.14 |
LT, LTE, EQ, NOT_EQ, GTE, GT |
An integer or float, e.g., 10.14 |
|
| mrr | BETWEEN |
Two comma-separated integers or floats, e.g., 0,10.14 |
LT, LTE, EQ, NOT_EQ, GTE, GT |
An integer or float, e.g., 10.14 |
|
| net_ |
BETWEEN |
Two comma-separated integers or floats, e.g., 0,10.14 |
LT, LTE, EQ, NOT_EQ, GTE, GT |
An integer or float, e.g., 10.14 |
|
| next_ |
BETWEEN |
Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01 |
LT, LTE, EQ, GTE, GT, IS, IS_NOT |
An ISO 8601 date, e.g., 2025-12-06 or NULL |
|
| owner | ANY, NONE, IS, IS_NOT |
NULL or comma-separated integers representing owners, e.g., 0,118,999,88199,9119,725 |
| paid_ |
BETWEEN |
Two comma-separated integers, e.g., 0,11 |
LT, LTE, EQ, NOT_EQ, GTE, GT |
An integer, e.g., 3 |
|
| paid_ |
BETWEEN |
Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01 |
LT, LTE, EQ, GTE, GT, IS, IS_NOT |
An ISO 8601 date, e.g., 2025-12-06 or NULL |
|
| plan_ |
ANY, NONE |
Comma-separated plan UUIDs, e.g., pl_ |
| plan_ |
IS_NOT, ALL, ANY, NONE |
NULL or comma-separated plan UUIDs, e.g., pl_ |
| plan_ |
IS_NOT, ALL, ANY, NONE |
NULL or comma-separated plan UUIDs, e.g., pl_ |
| plan | ALL, ANY, NONE |
Comma-separated plan UUIDs, e.g., pl_ |
| plan_ |
ALL, ANY, NONE |
Comma-separated plan UUIDs, e.g., pl_ |
| reactivated_ |
BETWEEN |
Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01 |
LT, LTE, EQ, GTE, GT, IS, IS_NOT |
An ISO 8601 date, e.g., 2025-12-06 or NULL |
|
| region | ANY, NONE, IS, IS_NOT |
NULL or comma-separated, single-quoted strings, e.g., 'US','FR' |
| renewal_ |
BETWEEN |
Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01 |
LT, LTE, EQ, GTE, GT, IS, IS_NOT |
An ISO 8601 date, e.g., 2025-12-06 or NULL |
|
| subscriber_ |
BETWEEN |
Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01 |
LT, LTE, EQ, GTE, GT, IS, IS_NOT |
An ISO 8601 date, e.g., 2025-12-06 or NULL |
|
| successful_ |
BETWEEN |
Two comma-separated integers, e.g., 0,11 |
LT, LTE, EQ, NOT_EQ, GTE, GT |
An integer, e.g., 3 |
|
| tags | ALL, ANY, NONE, IS, IS_NOT |
NULL or comma-separated, single-quoted strings, e.g., 'managed_account','churn_risk' |
| trial_ |
BETWEEN |
Two comma-separated integers, e.g., 0,11 |
LT, LTE, EQ, NOT_EQ, GTE, GT |
An integer, e.g., 3 |
|
| trial_ |
BETWEEN |
Two comma-separated integers, e.g., 0,11 |
LT, LTE, EQ, NOT_EQ, GTE, GT |
An integer, e.g., 3 |
|
| website | ANY, NONE |
NULL or comma-separated, single-quoted strings, e.g., 'https://myriapodlabs.com', |
EQ, NOT_EQ, CONTAINS, NOT_CONTAINS, IS, IS_NOT |
NULL or a single-quoted string, e.g., 'https://myriapodlabs.com' |
|
| custom_ |
EQ, IS_NULL_OR_EQ |
TRUE or FALSE |
| custom_ |
BETWEEN |
Two comma-separated ISO 8601 dates, e.g., 2025-01-01,2025-06-01 |
LT, LTE, EQ, GTE, GT, IS, IS_NOT |
An ISO 8601 date, e.g., 2025-12-06 |
|
| custom_ |
BETWEEN |
Two comma-separated floats, e.g., 0.01,9.99 |
LT, LTE, EQ, NOT_EQ, GTE, GT |
A float, e.g., 10.14 |
|
| custom_ |
BETWEEN |
Two comma-separated integers, e.g., 0,11 |
LT, LTE, EQ, NOT_EQ, GTE, GT |
An integer, e.g., 3 |
|
| custom_ |
EQ, NOT_EQ, CONTAINS, NOT_CONTAINS, IS, IS_NOT |
NULL or a single-quoted string, e.g., 'medtech' |
| custom_ |
ANY, NONE |
NULL or comma-separated, single-quoted strings, e.g., 'medtech','fintech' |