Q: What are multi-stage calculations and nested aggregates in Cube?
Multi-stage calculations are computed measures that depend on the results of other aggregated measures — essentially, calculations built on top of calculations. Nested aggregates are a related concept where one aggregate function is applied over the result of another. Both features allow you to express more complex analytical queries directly in your Cube data model.
Q: Don’t these features require the Tesseract SQL planner?
According to Cube’s documentation, multi-stage calculations and nested aggregates are listed as requiring the Tesseract SQL planner (enabled via the CUBEJS_TESSERACT_SQL_PLANNER environment variable). However, our testing with Cube v1.3.24 in the Embeddable workspace revealed that a significant subset of these features work correctly even without Tesseract fully enabled.
Q: What exactly was tested?
We created separate data models for each feature — multi-stage calculations and nested aggregates — and validated them against the Embeddable workspace running Cube v1.3.24. The goal was to determine which capabilities are functional out of the box and which are blocked by the absence of full Tesseract support.
Q: What features work in Cube v1.3.24 without Tesseract?
The following features were validated and work correctly:
| Docs | Feature | Notes |
|---|---|---|
| Rolling Window | Rolling window (trailing, unbounded) | Date range filter required |
| Period-to-date | Period-to-date (type: to_date YTD/QTD/MTD) | Date range filter required |
| Time-shift | Time shift (time_shift) | |
| Fixed dimension | Fixed dimension / percent of total (group_by) | |
| Nested aggregated (add_group_by) | Nested aggregate (add_group_by) | |
| nested aggregated (sub_query: true) | Classic nested aggregates (sub_query: true) | |
| Listed here on docs. | Pre-aggregations with multi-stage |
Q: What features do NOT work in Cube v1.3.24?
| Docs | Feature | Why it fails |
|---|---|---|
| Ranking | type: rank on measures | Build error — not in accepted enum values |
| Switch in dimension | type: switch on dimensions | Build error — not in accepted enum values |
| Conditional Measure | Conditional measure (case/switch) | Blocked by type: switch not being supported |
| Rolling Windows without filter | Rolling windows without a date range filter | Runtime error: “Time series queries without dateRange aren’t supported” — resolved in Tesseract |
Q: Why do rolling windows require a date range filter?
In Cube v1.3.24 without Tesseract, time series queries — including rolling windows and period-to-date calculations — require an explicit date range filter to function. Without one, the query fails at runtime. Tesseract resolves this by supporting time series queries without a mandatory date range, but until Tesseract is fully available, you’ll need to ensure a date range filter is always applied.
Q: What should I do if a feature I need isn’t supported?
If your use case depends on ranking, switch-based dimensions, conditional measures, or filterless rolling windows, these are currently blocked in Cube v1.3.24 without Tesseract. Your options include restructuring the logic using supported features (e.g., using sub_query: true for nested aggregates, or applying date range filters for rolling windows), or reaching out to the Embeddable or Cube support teams for guidance on workarounds. Full support is expected when Tesseract becomes available in a future Cube release.
Q: Will full Tesseract support be available in a future version?
Tesseract is an actively developed component of the Cube platform. Full support is expected in future releases, which would unlock the complete set of multi-stage and nested aggregate capabilities — including ranking, switch types, conditional measures, and filterless rolling windows. Check the Cube changelog and Embeddable release notes for updates on Tesseract availability.
