Business analysis
analytics pareto <json_rows> <key> <value>
Description
Pareto / ABC analysis: the items sorted by value with their share and cumulative share, class A (the first 80 % of the value), B (the next 15 %), C (the rest), and the summary of each class
Pareto / ABC analysis: the items sorted by value with their share and cumulative share, class A (the first 80 % of the value), B (the next 15 %), C (the rest), and the summary of each class
Parameters
json_rows: The rows - String - required
key: The item field - String - required
value: The value field - String - required
json_rows: The rows - String - required
key: The item field - String - required
value: The value field - String - required
admin
analytics pareto "[{\"sku\": \"A\", \"revenue\": 52000}, {\"sku\": \"B\", \"revenue\": 21000}, {\"sku\": \"C\", \"revenue\": 9000}, {\"sku\": \"D\", \"revenue\": 7000}, {\"sku\": \"E\", \"revenue\": 4500}, {\"sku\": \"F\", \"revenue\": 3000}, {\"sku\": \"G\", \"revenue\": 2000}, {\"sku\": \"H\", \"revenue\": 1500}]" "sku" "revenue"
mentdb
{"total": 100000, "classes": {"A": {"items": 3, "item_share": 0.375, "value_share": 0.82}, "B": {"items": 3, "item_share": 0.375, "value_share": 0.145}, "C": {"items": 2, "item_share": 0.25, "value_share": 0.035}}, "items": [{"sku": "A", "value": 52000, "share": 0.52, "cumulative_share": 0.52, "class": "A"}, {"sku": "B", "value": 21000, "share": 0.21, "cumulative_share": 0.73, "class": "A"}, {"sku": "C", "value": 9000, "share": 0.09, "cumulative_share": 0.82, "class": "A"}, {"sku": "D", "value": 7000, "share": 0.07, "cumulative_share": 0.89, "class": "B"}, {"sku": "E", "value": 4500, "share": 0.045, "cumulative_share": 0.935, "class": "B"}, {"sku": "F", "value": 3000, "share": 0.03, "cumulative_share": 0.965, "class": "B"}, {"sku": "G", "value": 2000, "share": 0.02, "cumulative_share": 0.985, "class": "C"}, {"sku": "H", "value": 1500, "share": 0.015, "cumulative_share": 1, "class": "C"}]}
analytics pareto <json_rows> <key> <value> <json_limits>
Description
Pareto with other limits of the classes
Pareto with other limits of the classes
Parameters
json_rows: The rows - String - required
key: The item field - String - required
value: The value field - String - required
json_limits: [a, b], ex: [0.7, 0.9] - String - required
json_rows: The rows - String - required
key: The item field - String - required
value: The value field - String - required
json_limits: [a, b], ex: [0.7, 0.9] - String - required
admin
analytics pareto "[{\"sku\": \"A\", \"revenue\": 52000}, {\"sku\": \"B\", \"revenue\": 21000}, {\"sku\": \"C\", \"revenue\": 9000}, {\"sku\": \"D\", \"revenue\": 7000}, {\"sku\": \"E\", \"revenue\": 4500}, {\"sku\": \"F\", \"revenue\": 3000}, {\"sku\": \"G\", \"revenue\": 2000}, {\"sku\": \"H\", \"revenue\": 1500}]" "sku" "revenue" "[0.7, 0.9]"
mentdb
{"total": 100000, "classes": {"A": {"items": 2, "item_share": 0.25, "value_share": 0.73}, "B": {"items": 3, "item_share": 0.375, "value_share": 0.205}, "C": {"items": 3, "item_share": 0.375, "value_share": 0.065}}, "items": [{"sku": "A", "value": 52000, "share": 0.52, "cumulative_share": 0.52, "class": "A"}, {"sku": "B", "value": 21000, "share": 0.21, "cumulative_share": 0.73, "class": "A"}, {"sku": "C", "value": 9000, "share": 0.09, "cumulative_share": 0.82, "class": "B"}, {"sku": "D", "value": 7000, "share": 0.07, "cumulative_share": 0.89, "class": "B"}, {"sku": "E", "value": 4500, "share": 0.045, "cumulative_share": 0.935, "class": "B"}, {"sku": "F", "value": 3000, "share": 0.03, "cumulative_share": 0.965, "class": "C"}, {"sku": "G", "value": 2000, "share": 0.02, "cumulative_share": 0.985, "class": "C"}, {"sku": "H", "value": 1500, "share": 0.015, "cumulative_share": 1, "class": "C"}]}
analytics rfm <json_rows> <customer> <date> <amount> <reference_date>
Description
RFM segmentation: recency (days since the last purchase at the reference date), frequency, monetary, scores 1 to 5 (quintiles, 5 = best) and a segment (champions, loyal, potential, new, at_risk, hibernating, lost)
RFM segmentation: recency (days since the last purchase at the reference date), frequency, monetary, scores 1 to 5 (quintiles, 5 = best) and a segment (champions, loyal, potential, new, at_risk, hibernating, lost)
Parameters
json_rows: The orders - String - required
customer: The customer field - String - required
date: The date field - String - required
amount: The amount field - String - required
reference_date: The reference date - String - required
json_rows: The orders - String - required
customer: The customer field - String - required
date: The date field - String - required
amount: The amount field - String - required
reference_date: The reference date - String - required
admin
analytics rfm "[{\"c\": \"ann\", \"d\": \"2026-10-28\", \"a\": 120}, {\"c\": \"ann\", \"d\": \"2026-09-15\", \"a\": 80}, {\"c\": \"ann\", \"d\": \"2026-08-02\", \"a\": 95}, {\"c\": \"bob\", \"d\": \"2026-03-10\", \"a\": 400}, {\"c\": \"bob\", \"d\": \"2026-02-01\", \"a\": 350}, {\"c\": \"cid\", \"d\": \"2026-10-30\", \"a\": 30}, {\"c\": \"dan\", \"d\": \"2026-06-20\", \"a\": 60}, {\"c\": \"dan\", \"d\": \"2026-07-22\", \"a\": 75}, {\"c\": \"eve\", \"d\": \"2026-01-05\", \"a\": 20}]" "c" "d" "a" "2026-11-01"
mentdb
{"customers": 5, "segments": {"champions": 1, "hibernating": 1, "lost": 1, "new": 1, "potential": 1}, "table": [{"c": "ann", "recency": 4, "frequency": 3, "monetary": 295, "r": 4, "f": 5, "m": 4, "rfm": "454", "segment": "champions"}, {"c": "bob", "recency": 236, "frequency": 2, "monetary": 750, "r": 2, "f": 3, "m": 5, "rfm": "235", "segment": "hibernating"}, {"c": "cid", "recency": 2, "frequency": 1, "monetary": 30, "r": 5, "f": 1, "m": 2, "rfm": "512", "segment": "new"}, {"c": "dan", "recency": 102, "frequency": 2, "monetary": 135, "r": 3, "f": 3, "m": 3, "rfm": "333", "segment": "potential"}, {"c": "eve", "recency": 300, "frequency": 1, "monetary": 20, "r": 1, "f": 1, "m": 1, "rfm": "111", "segment": "lost"}]}
analytics cohort <json_rows> <customer> <date>
Description
Cohorts by month of the first activity: size, active customers and retention for each month after
Cohorts by month of the first activity: size, active customers and retention for each month after
Parameters
json_rows: The activities - String - required
customer: The customer field - String - required
date: The date field - String - required
json_rows: The activities - String - required
customer: The customer field - String - required
date: The date field - String - required
admin
analytics cohort "[{\"u\": \"a\", \"d\": \"2026-01-03\"}, {\"u\": \"a\", \"d\": \"2026-02-10\"}, {\"u\": \"a\", \"d\": \"2026-03-02\"}, {\"u\": \"b\", \"d\": \"2026-01-20\"}, {\"u\": \"c\", \"d\": \"2026-01-25\"}, {\"u\": \"c\", \"d\": \"2026-03-15\"}, {\"u\": \"d\", \"d\": \"2026-02-05\"}, {\"u\": \"d\", \"d\": \"2026-03-07\"}, {\"u\": \"e\", \"d\": \"2026-02-18\"}]" "u" "d"
mentdb
[{"cohort": "2026-01", "size": 3, "active": [3, 1, 2], "retention": [1, 0.333, 0.667]}, {"cohort": "2026-02", "size": 2, "active": [2, 1], "retention": [1, 0.5]}]
analytics funnel <json_rows> <user> <step> <json_steps>
Description
Conversion funnel: the users who reached each step in the order of the steps, the conversion from the previous step and from the first
Conversion funnel: the users who reached each step in the order of the steps, the conversion from the previous step and from the first
Parameters
json_rows: The events in time order - String - required
user: The user field - String - required
step: The step field - String - required
json_steps: The steps in order - String - required
json_rows: The events in time order - String - required
user: The user field - String - required
step: The step field - String - required
json_steps: The steps in order - String - required
admin
analytics funnel "[{\"u\": 1, \"s\": \"visit\"}, {\"u\": 1, \"s\": \"cart\"}, {\"u\": 1, \"s\": \"pay\"}, {\"u\": 2, \"s\": \"visit\"}, {\"u\": 2, \"s\": \"cart\"}, {\"u\": 3, \"s\": \"visit\"}, {\"u\": 4, \"s\": \"visit\"}, {\"u\": 4, \"s\": \"pay\"}, {\"u\": 5, \"s\": \"visit\"}, {\"u\": 5, \"s\": \"cart\"}, {\"u\": 5, \"s\": \"pay\"}]" "u" "s" "[\"visit\", \"cart\", \"pay\"]"
mentdb
[{"step": "visit", "users": 5, "from_previous": null, "from_first": 1}, {"step": "cart", "users": 3, "from_previous": 0.6, "from_first": 0.6}, {"step": "pay", "users": 2, "from_previous": 0.6666666666666666, "from_first": 0.4}]
analytics abtest <conversions_a> <n_a> <conversions_b> <n_b>
Description
A/B test of two conversion rates: difference with its 95 % interval, lift, z test p-value, significant, probability that B is better (Bayesian, Beta posteriors)
A/B test of two conversion rates: difference with its 95 % interval, lift, z test p-value, significant, probability that B is better (Bayesian, Beta posteriors)
Parameters
conversions_a: Conversions of A - Number - required
n_a: Visitors of A - Number - required
conversions_b: Conversions of B - Number - required
n_b: Visitors of B - Number - required
conversions_a: Conversions of A - Number - required
n_a: Visitors of A - Number - required
conversions_b: Conversions of B - Number - required
n_b: Visitors of B - Number - required
admin
analytics abtest 120 2400 156 2380
mentdb
{"rate_a": 0.05, "rate_b": 0.06554621848739496, "difference": 0.015546218487394958, "lower": 0.002321627657792834, "upper": 0.028770809316997083, "lift": 0.31092436974789917, "z": 2.3039820049553317, "p_value": 0.021223653756259786, "significant": true, "probability_b_better": 0.98915}
