|
215 | 215 | "Metric": { |
216 | 216 | "description": "Measure definition - supports simple aggregations and complex metric types.\n\nMeasures can be:\n- Simple aggregations: SUM(amount), COUNT(*), AVG(price)\n- Ratios: revenue / order_count\n- Derived formulas: (revenue - cost) / revenue\n- Cumulative: running totals, period-to-date\n- Time comparisons: YoY, MoM growth\n- Conversion funnels: signup -> purchase rate\n\nAuto-registers as a graph-level metric with the current semantic layer context if available.", |
217 | 217 | "properties": { |
| 218 | + "activity_event": { |
| 219 | + "anyOf": [ |
| 220 | + { |
| 221 | + "type": "string" |
| 222 | + }, |
| 223 | + { |
| 224 | + "type": "null" |
| 225 | + } |
| 226 | + ], |
| 227 | + "default": null, |
| 228 | + "description": "SQL filter for activity event (default: any event, e.g., \"event IS NOT NULL\")", |
| 229 | + "title": "Activity Event" |
| 230 | + }, |
218 | 231 | "agg": { |
219 | 232 | "anyOf": [ |
220 | 233 | { |
|
285 | 298 | "description": "Comparison calculation (default: percent_change)", |
286 | 299 | "title": "Calculation" |
287 | 300 | }, |
| 301 | + "cohort_event": { |
| 302 | + "anyOf": [ |
| 303 | + { |
| 304 | + "type": "string" |
| 305 | + }, |
| 306 | + { |
| 307 | + "type": "null" |
| 308 | + } |
| 309 | + ], |
| 310 | + "default": null, |
| 311 | + "description": "SQL filter for cohort-defining event (e.g., \"event = 'install'\")", |
| 312 | + "title": "Cohort Event" |
| 313 | + }, |
288 | 314 | "comparison_type": { |
289 | 315 | "anyOf": [ |
290 | 316 | { |
|
553 | 579 | "description": "Time offset for denominator (e.g., '1 month')", |
554 | 580 | "title": "Offset Window" |
555 | 581 | }, |
| 582 | + "periods": { |
| 583 | + "anyOf": [ |
| 584 | + { |
| 585 | + "type": "integer" |
| 586 | + }, |
| 587 | + { |
| 588 | + "type": "null" |
| 589 | + } |
| 590 | + ], |
| 591 | + "default": null, |
| 592 | + "description": "Number of retention periods to compute (e.g., 28 for 28-day)", |
| 593 | + "title": "Periods" |
| 594 | + }, |
556 | 595 | "public": { |
557 | 596 | "default": true, |
558 | 597 | "description": "Whether metric is visible in API/UI", |
559 | 598 | "title": "Public", |
560 | 599 | "type": "boolean" |
561 | 600 | }, |
| 601 | + "retention_granularity": { |
| 602 | + "anyOf": [ |
| 603 | + { |
| 604 | + "enum": [ |
| 605 | + "day", |
| 606 | + "week", |
| 607 | + "month" |
| 608 | + ], |
| 609 | + "type": "string" |
| 610 | + }, |
| 611 | + { |
| 612 | + "type": "null" |
| 613 | + } |
| 614 | + ], |
| 615 | + "default": null, |
| 616 | + "description": "Time granularity for retention periods (day, week, month)", |
| 617 | + "title": "Retention Granularity" |
| 618 | + }, |
562 | 619 | "sql": { |
563 | 620 | "anyOf": [ |
564 | 621 | { |
|
593 | 650 | "derived", |
594 | 651 | "cumulative", |
595 | 652 | "time_comparison", |
596 | | - "conversion" |
| 653 | + "conversion", |
| 654 | + "retention" |
597 | 655 | ], |
598 | 656 | "type": "string" |
599 | 657 | }, |
|
1148 | 1206 | "items": { |
1149 | 1207 | "description": "Measure definition - supports simple aggregations and complex metric types.\n\nMeasures can be:\n- Simple aggregations: SUM(amount), COUNT(*), AVG(price)\n- Ratios: revenue / order_count\n- Derived formulas: (revenue - cost) / revenue\n- Cumulative: running totals, period-to-date\n- Time comparisons: YoY, MoM growth\n- Conversion funnels: signup -> purchase rate\n\nAuto-registers as a graph-level metric with the current semantic layer context if available.", |
1150 | 1208 | "properties": { |
| 1209 | + "activity_event": { |
| 1210 | + "anyOf": [ |
| 1211 | + { |
| 1212 | + "type": "string" |
| 1213 | + }, |
| 1214 | + { |
| 1215 | + "type": "null" |
| 1216 | + } |
| 1217 | + ], |
| 1218 | + "default": null, |
| 1219 | + "description": "SQL filter for activity event (default: any event, e.g., \"event IS NOT NULL\")", |
| 1220 | + "title": "Activity Event" |
| 1221 | + }, |
1151 | 1222 | "agg": { |
1152 | 1223 | "anyOf": [ |
1153 | 1224 | { |
|
1218 | 1289 | "description": "Comparison calculation (default: percent_change)", |
1219 | 1290 | "title": "Calculation" |
1220 | 1291 | }, |
| 1292 | + "cohort_event": { |
| 1293 | + "anyOf": [ |
| 1294 | + { |
| 1295 | + "type": "string" |
| 1296 | + }, |
| 1297 | + { |
| 1298 | + "type": "null" |
| 1299 | + } |
| 1300 | + ], |
| 1301 | + "default": null, |
| 1302 | + "description": "SQL filter for cohort-defining event (e.g., \"event = 'install'\")", |
| 1303 | + "title": "Cohort Event" |
| 1304 | + }, |
1221 | 1305 | "comparison_type": { |
1222 | 1306 | "anyOf": [ |
1223 | 1307 | { |
|
1486 | 1570 | "description": "Time offset for denominator (e.g., '1 month')", |
1487 | 1571 | "title": "Offset Window" |
1488 | 1572 | }, |
| 1573 | + "periods": { |
| 1574 | + "anyOf": [ |
| 1575 | + { |
| 1576 | + "type": "integer" |
| 1577 | + }, |
| 1578 | + { |
| 1579 | + "type": "null" |
| 1580 | + } |
| 1581 | + ], |
| 1582 | + "default": null, |
| 1583 | + "description": "Number of retention periods to compute (e.g., 28 for 28-day)", |
| 1584 | + "title": "Periods" |
| 1585 | + }, |
1489 | 1586 | "public": { |
1490 | 1587 | "default": true, |
1491 | 1588 | "description": "Whether metric is visible in API/UI", |
1492 | 1589 | "title": "Public", |
1493 | 1590 | "type": "boolean" |
1494 | 1591 | }, |
| 1592 | + "retention_granularity": { |
| 1593 | + "anyOf": [ |
| 1594 | + { |
| 1595 | + "enum": [ |
| 1596 | + "day", |
| 1597 | + "week", |
| 1598 | + "month" |
| 1599 | + ], |
| 1600 | + "type": "string" |
| 1601 | + }, |
| 1602 | + { |
| 1603 | + "type": "null" |
| 1604 | + } |
| 1605 | + ], |
| 1606 | + "default": null, |
| 1607 | + "description": "Time granularity for retention periods (day, week, month)", |
| 1608 | + "title": "Retention Granularity" |
| 1609 | + }, |
1495 | 1610 | "sql": { |
1496 | 1611 | "anyOf": [ |
1497 | 1612 | { |
|
1526 | 1641 | "derived", |
1527 | 1642 | "cumulative", |
1528 | 1643 | "time_comparison", |
1529 | | - "conversion" |
| 1644 | + "conversion", |
| 1645 | + "retention" |
1530 | 1646 | ], |
1531 | 1647 | "type": "string" |
1532 | 1648 | }, |
|
1831 | 1947 | "Metric": { |
1832 | 1948 | "description": "Measure definition - supports simple aggregations and complex metric types.\n\nMeasures can be:\n- Simple aggregations: SUM(amount), COUNT(*), AVG(price)\n- Ratios: revenue / order_count\n- Derived formulas: (revenue - cost) / revenue\n- Cumulative: running totals, period-to-date\n- Time comparisons: YoY, MoM growth\n- Conversion funnels: signup -> purchase rate\n\nAuto-registers as a graph-level metric with the current semantic layer context if available.", |
1833 | 1949 | "properties": { |
| 1950 | + "activity_event": { |
| 1951 | + "anyOf": [ |
| 1952 | + { |
| 1953 | + "type": "string" |
| 1954 | + }, |
| 1955 | + { |
| 1956 | + "type": "null" |
| 1957 | + } |
| 1958 | + ], |
| 1959 | + "default": null, |
| 1960 | + "description": "SQL filter for activity event (default: any event, e.g., \"event IS NOT NULL\")", |
| 1961 | + "title": "Activity Event" |
| 1962 | + }, |
1834 | 1963 | "agg": { |
1835 | 1964 | "anyOf": [ |
1836 | 1965 | { |
|
1901 | 2030 | "description": "Comparison calculation (default: percent_change)", |
1902 | 2031 | "title": "Calculation" |
1903 | 2032 | }, |
| 2033 | + "cohort_event": { |
| 2034 | + "anyOf": [ |
| 2035 | + { |
| 2036 | + "type": "string" |
| 2037 | + }, |
| 2038 | + { |
| 2039 | + "type": "null" |
| 2040 | + } |
| 2041 | + ], |
| 2042 | + "default": null, |
| 2043 | + "description": "SQL filter for cohort-defining event (e.g., \"event = 'install'\")", |
| 2044 | + "title": "Cohort Event" |
| 2045 | + }, |
1904 | 2046 | "comparison_type": { |
1905 | 2047 | "anyOf": [ |
1906 | 2048 | { |
|
2169 | 2311 | "description": "Time offset for denominator (e.g., '1 month')", |
2170 | 2312 | "title": "Offset Window" |
2171 | 2313 | }, |
| 2314 | + "periods": { |
| 2315 | + "anyOf": [ |
| 2316 | + { |
| 2317 | + "type": "integer" |
| 2318 | + }, |
| 2319 | + { |
| 2320 | + "type": "null" |
| 2321 | + } |
| 2322 | + ], |
| 2323 | + "default": null, |
| 2324 | + "description": "Number of retention periods to compute (e.g., 28 for 28-day)", |
| 2325 | + "title": "Periods" |
| 2326 | + }, |
2172 | 2327 | "public": { |
2173 | 2328 | "default": true, |
2174 | 2329 | "description": "Whether metric is visible in API/UI", |
2175 | 2330 | "title": "Public", |
2176 | 2331 | "type": "boolean" |
2177 | 2332 | }, |
| 2333 | + "retention_granularity": { |
| 2334 | + "anyOf": [ |
| 2335 | + { |
| 2336 | + "enum": [ |
| 2337 | + "day", |
| 2338 | + "week", |
| 2339 | + "month" |
| 2340 | + ], |
| 2341 | + "type": "string" |
| 2342 | + }, |
| 2343 | + { |
| 2344 | + "type": "null" |
| 2345 | + } |
| 2346 | + ], |
| 2347 | + "default": null, |
| 2348 | + "description": "Time granularity for retention periods (day, week, month)", |
| 2349 | + "title": "Retention Granularity" |
| 2350 | + }, |
2178 | 2351 | "sql": { |
2179 | 2352 | "anyOf": [ |
2180 | 2353 | { |
|
2209 | 2382 | "derived", |
2210 | 2383 | "cumulative", |
2211 | 2384 | "time_comparison", |
2212 | | - "conversion" |
| 2385 | + "conversion", |
| 2386 | + "retention" |
2213 | 2387 | ], |
2214 | 2388 | "type": "string" |
2215 | 2389 | }, |
|
0 commit comments