用法
view: view_name {
measure: field_name {
direction: "row"
}
}
|
层次结构
direction |
可能的字段类型
测量
接受
row 或 column
|
定义
如果将 type: percent_of_total 或 type: running_total 的度量与透视表搭配使用,您可以使用 direction 控制计算方向。
透视后,这些计算的默认方向是跨行。有时,用户希望按列执行计算。可使用 direction: "column" 实现这一目的。
measure: running_order_total {
type: running_total
sql: ${order_total} ;;
direction: "row" # Calculation across the row (default)
}
measure: running_order_total {
type: running_total
sql: ${order_total} ;;
direction: "column" # Calculation down the column (row is default)
}