cube
cube copied to clipboard
rollup pre-aggregation alias bug
Describe the bug
When using rollup type pre-aggregation, the alias name of the measure is the same before and after aggregation. So, when adding a filter on the measure, BigQuery is not able to distinguish in the "having" clause, causing Aggregations of aggregations are not allowed error.
To Reproduce (I am using BigQuery, not sure whether any other DW has the same issue)
- Define any measure in rollup type pre-aggregation
- Select the measure in playground
- Add any filter on that measure
- See error
Expected behavior Maybe change the alias format in pre-aggregation
Screenshots

Version: 0.28.41
If you are interested in working on this issue, please leave a comment below and we will be happy to assign the issue to you. If this is the first time you are contributing a Pull Request to Cube.js, please check our contribution guidelines. You can also post any questions while contributing in the #contributors channel in the Cube.js Slack.
Hey @HsienWeiWang ! The use of internal pre-aggregations isn't encouraged. You can use Cube Store in order to workaround this problem.
@HsienWeiWang Any workaround you have found for this or have you just started using CubeStore?
@rajatch80 Does this reproduce for you as well? On which version of Cube (if you don't mind sharing)?
Indeed, storing pre-aggregations in the original data source is not recommended. Please use Cube Store.
I am using the latest version of Cube. I am comparing two data sources (Snowflake and Clickhouse). Hence, I wanted to do it without cubestore first. Is there no way without using cubestore?
@rajatch80 If you don't want to use Cube Store, you can comment out the pre-aggregations in your data model and have Cube query your upstream data sources directly.
Using external databases for pre-aggregations has been deprecated. Please use Cube Store instead. Looks like this issue is not relevant anymore, so closing it.