Open
Description
In cube.js there is not a feature when you want to apply rounding after the additive measured value.
some_measure_1: {
sql: `
${CUBE}.col1 - ${CUBE}.col2
`,
type: `sum`,
}
we have to introduce another measure for its rounded value
some_measure_2: {
sql: `
ROUND(${CUBE.some_measure_1}, 2)
`,
type: `number`,
}
or we have to change the type to number and introduce our own sql
some_measure_3: {
sql: `
ROUMD(SUM({CUBE.some_measure_1}),2)
`,
type: `number`,
}
I am currently using this approach.
There should be some in additive measure object that should should accept rounding integer if required.
like
some_measure_1: {
sql: `
${CUBE}.col1 - ${CUBE}.col2
`,
type: `sum`,
round: 2
}