# direction

<br />

## Usage

```
view: view_name {
  measure: field_name {
    direction: "row"
  }
}
```

|---|---|
| Hierarchy [View File](https://docs.cloud.google.com/looker/docs/reference/param-view) [`view`](https://docs.cloud.google.com/looker/docs/reference/param-view-view) [Field Type](https://docs.cloud.google.com/looker/docs/reference/param-field) `direction` | Possible Field Types Measure <br /> Accepts Either `row` or `column` |

## Definition

If a measure of `type: percent_of_total` or `type: running_total` is used with a pivot, you can control the direction of the calculation using `direction`.

When pivoted, the default direction for these calculations is across the row. Sometimes users prefer the calculation to be performed down the column. This can be done by using `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)
    }