File tree Expand file tree Collapse file tree
docs-mintlify/docs/data-modeling/concepts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -278,6 +278,19 @@ cube(`users`, {
278278
279279</CodeGroup >
280280
281+ <Note >
282+
283+ You can safely reference a member whose ` sql ` is a compound expression, such as
284+ arithmetic (` {price} + {tax} ` ) or boolean logic (` {is_paid} OR {is_pending} ` ). When you
285+ reference such a member inside an arithmetic or logical expression, Cube wraps it in
286+ parentheses automatically, so operator precedence is preserved. For example, if
287+ ` price_with_tax ` is defined as ` {price} + {tax} ` , then referencing it as
288+ ` {price_with_tax} * {quantity} ` generates ` (price + tax) * quantity ` . Cube only adds these
289+ parentheses where they are needed — a reference that already sits in a safe position, such as
290+ a function argument (` ABS({price_with_tax}) ` ) or a ` CAST(...) ` , is left unwrapped.
291+
292+ </Note >
293+
281294This syntax works great for simple use cases. However, there are cases
282295(like [ subquery] [ ref-subquery ] ) when you'd like to reference members of
283296other cubes. See below how to do that.
You can’t perform that action at this time.
0 commit comments