business analytics
slug: step-paretoPerforms Pareto (80/20) analysis on data to identify the vital few segments that contribute disproportionately to the total. Calculates concentration metrics, inequality indicators, and ABC categorization for strategic prioritization.
measure (string) - Base column name to analyze (e.g., "revenue")metric (string) - Metric to use from cube data (e.g., "sum") - combined as "measure.metric"level (integer) - Analysis level for hierarchical data (if null, uses all data)paretoThresholds (array) - Percentage thresholds for Pareto analysis (default: [80, 90, 95])abcBreakpoints (array) - Percentage thresholds for ABC categorization (default: [80, 95])calculateGini (boolean) - Whether to calculate Gini coefficient (default: true)includeRankPercentile (boolean) - Whether to include rank percentile column (default: true)measure.metricAll original columns plus:
rank - Ordinal position after sorting (1 = highest value)rankPercentile - Percentile rank (0-100%)segmentValue - Value of this segment (from measure.metric)segmentPct - Percentage of total contributed by this segmentcumulativeValue - Running total value up to this segmentcumulativePct - Running percentage of total up to this segmentabcCategory - A, B, or C category based on cumulative contributionparetoFlag - Boolean indicating if segment is part of the "vital few"Detailed statistics stored in extras.stats.pareto:
totalValue - Sum of all segment valuestotalSegments - Number of segments analyzedginiCoefficient - Measure of inequality distributionparetoPoints - Segments needed to reach each threshold:
count - Number of segmentspctOfTotal - Percentage of total segmentscategoryCounts - Count of segments in each ABC categorycategoryValues - Sum of values in each ABC categoryconcentrationRatios - Percentage of value from top 10%, 25%, and 50% of segmentspareto:
measure: revenue
metric: sum
pareto:
measure: profit
metric: sum
level: 1
abcBreakpoints: [70, 90]
paretoThresholds: [70, 80, 90, 95]
| level | region | product_category | revenue.sum | revenue.pctSum |
|---|---|---|---|---|
| 1 | North | All | 452500 | 50.00% |
| 1 | South | All | 453000 | 50.00% |
| 2 | North | Electronics | 270000 | 29.82% |
| 2 | North | Furniture | 182500 | 20.15% |
| 2 | South | Electronics | 216000 | 23.85% |
| 2 | South | Furniture | 237000 | 26.17% |
| level | region | product_category | revenue.sum | rank | segmentPct | cumulativePct | abcCategory | paretoFlag |
|---|---|---|---|---|---|---|---|---|
| 2 | North | Electronics | 270000 | 1 | 29.82 | 29.82 | A | true |
| 2 | South | Furniture | 237000 | 2 | 26.17 | 55.99 | A | true |
| 2 | South | Electronics | 216000 | 3 | 23.85 | 79.84 | A | true |
| 2 | North | Furniture | 182500 | 4 | 20.15 | 100.00 | B | false |
extras.stats.pareto = {
"level": 2,
"measure": "revenue",
"metric": "sum",
"totalValue": 905500,
"totalSegments": 4,
"giniCoefficient": 0.0498,
"paretoPoints": {
"80": {
"count": 3,
"pctOfTotal": 75.00
},
"90": {
"count": 4,
"pctOfTotal": 100.00
},
"95": {
"count": 4,
"pctOfTotal": 100.00
}
},
"categoryCounts": {
"A": 3,
"B": 1,
"C": 0
},
"categoryValues": {
"A": 723000,
"B": 182500,
"C": 0
},
"concentrationRatios": {
"top10PctShare": 29.82,
"top25PctShare": 55.99,
"top50PctShare": 79.84
}
}