cube-js/cube
在 GitHub 查看Extra brackets need to be specified when using dynamic measures
Open
#6,064 创建于 2023年1月26日
help wanted
仓库指标
- Star
- (19,563 star)
- PR 合并指标
- (平均合并 5天 16小时) (30 天内合并 138 个 PR)
描述
Is your feature request related to a problem? Please describe. Example of schema:
"sales":{
"sql":"sum(${CUBE}."Sales")"
},
"wholesaleCost":{
"sql":"sum(${CUBE}."WholesaleCost")"
},
"profit":{
"sql":"${sales} - ${wholesaleCost}"
},
"someCoef":{
"sql":"${profit} / ${sales}"
}
This schema is not working. someCoef generates wrong formula${sales} - ${wholesaleCost}/${sales} while correct is (${sales} - ${wholesaleCost})/${sales}
It can be fixed in 2 ways:
- someCoef sql should be
(${profit}) / ${sales}(profit inside brackets) - profit sql should be
(${sales} - ${wholesaleCost})(whole formula inside brackets)
Describe the solution you'd like Cube should check and automatically add brackets if needed