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

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

Comparison operators

Range operators

Containment operators

Identity operators

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:

  1. Navigate to Reports in ChartMogul.
  2. Apply your desired filters.
  3. Copy the filters parameter value from the browser address bar. Screenshot of the MRR chart with filters applied with the value of the filters parameter highlighted in 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_quantity BETWEEN Two comma-separated integers, e.g., 0,11
LT, LTE, EQ, NOT_EQ, GTE, GT An integer, e.g., 3
active_subscriptions BETWEEN Two comma-separated integers, e.g., 0,11
LT, LTE, EQ, NOT_EQ, GTE, GT An integer, e.g., 3
average_order_value 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_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
churning_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
contacts_count BETWEEN Two comma-separated integers, e.g., 0,11
LT, LTE, EQ, NOT_EQ, GTE, GT An integer, e.g., 3
contracted_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
currency ALL, ANY, NONE Comma-separated, single-quoted ISO 4217 currency codes, e.g., 'EUR','USD'
customer_lifetime 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_aaa85a1e-719a-11ef-9288-f327e3cbde1d,cus_d406c60d-c2d0-477c-b03a-2a5cd1d533cf
customer_since 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_status ANY, NONE Comma-separated, single-quoted strings with customer status values: new_lead, working_lead, qualified_lead, unqualified_lead, active, past_due or cancelled, e.g., 'past_due','cancelled'
data_source ALL, ANY, NONE Comma-separated source UUIDs, e.g., ds_aaa85a1e-719a-11ef-9288-f327e3cbde1d,ds_d406c60d-c2d0-477c-b03a-2a5cd1d533cf
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_trial_started_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
has_discount EQ TRUE or FALSE
has_open_task EQ TRUE or FALSE
has_opportunity EQ TRUE or FALSE
last_active_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
last_communication_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
last_email_received_from_customer_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
last_email_sent_to_customer_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
last_payment 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_created_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
mrr_at_time_of_purchase 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_before_churn 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_payments 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_payment 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_quantity_before_churn BETWEEN Two comma-separated integers, e.g., 0,11
LT, LTE, EQ, NOT_EQ, GTE, GT An integer, e.g., 3
paid_subscriber_since 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_at_purchase ANY, NONE Comma-separated plan UUIDs, e.g., pl_aaa85a1e-719a-11ef-9288-f327e3cbde1d,pl_d406c60d-c2d0-477c-b03a-2a5cd1d533cf
plan_at_subscription_start IS_NOT, ALL, ANY, NONE NULL or comma-separated plan UUIDs, e.g., pl_aaa85a1e-719a-11ef-9288-f327e3cbde1d,pl_d406c60d-c2d0-477c-b03a-2a5cd1d533cf
plan_at_trial_start IS_NOT, ALL, ANY, NONE NULL or comma-separated plan UUIDs, e.g., pl_aaa85a1e-719a-11ef-9288-f327e3cbde1d,pl_d406c60d-c2d0-477c-b03a-2a5cd1d533cf
plan ALL, ANY, NONE Comma-separated plan UUIDs, e.g., pl_aaa85a1e-719a-11ef-9288-f327e3cbde1d,pl_d406c60d-c2d0-477c-b03a-2a5cd1d533cf
plan_sub_set ALL, ANY, NONE Comma-separated plan UUIDs, e.g., pl_aaa85a1e-719a-11ef-9288-f327e3cbde1d,pl_d406c60d-c2d0-477c-b03a-2a5cd1d533cf
reactivated_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
region ANY, NONE, IS, IS_NOT NULL or comma-separated, single-quoted strings, e.g., 'US','FR'
renewal_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
subscriber_since 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_payment_count 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_to_conversion_in_days BETWEEN Two comma-separated integers, e.g., 0,11
LT, LTE, EQ, NOT_EQ, GTE, GT An integer, e.g., 3
trial_to_paid_in_days 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','https://jellytech.com'
EQ, NOT_EQ, CONTAINS, NOT_CONTAINS, IS, IS_NOT NULL or a single-quoted string, e.g., 'https://myriapodlabs.com'
custom_attribute (boolean) EQ, IS_NULL_OR_EQ TRUE or FALSE
custom_attribute (date) 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_attribute (float) 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_attribute (integer) BETWEEN Two comma-separated integers, e.g., 0,11
LT, LTE, EQ, NOT_EQ, GTE, GT An integer, e.g., 3
custom_attribute (string) EQ, NOT_EQ, CONTAINS, NOT_CONTAINS, IS, IS_NOT NULL or a single-quoted string, e.g., 'medtech'
custom_attribute (string array) ANY, NONE NULL or comma-separated, single-quoted strings, e.g., 'medtech','fintech'