# Waterfall

The Waterfall step allows to generate a data structure useful to build waterfall charts. It breaks down the variation between two values (usually between two dates) accross entities. Entities are found in the `labelsColumn`, and can optionally be regrouped under common parents found in the `parentsColumn` for drill-down purposes.

### Step parameters

* `Value column name`: the name of the value column tht will be used to compute waterfall blocks values
* `Column incl. start and end labels (usually dates)`: name of the column that includes the labels of the starting and ending blocks of the waterfall (usually dates)
* `Starting block label`: the label of the starting block to find in the column above
* `Ending block label`: the label of the ending block to find in the column above
* `Labels columns (for intermediate blocks)`: the name of the column where intermediate blocks labels are to be found (used to break down the total variation between the starting and ending block)
* `(Optional) Parents labels column (for drill-down)`: the name of the column where parent labels are to be found if any, for drill-down purposes (parents of the labels specified above)
* `(Optional) Group waterfall by`: the columns used to group waterfall computation (useful to keep track of a column used for filtering for example)
* `Sort by`: whether to sort waterfall blocks depending on their labels or on their values
* `Sort order`: whether to use ascending or descending order when sorting

### Example

**Input**

<figure><img src="https://1809014303-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZxYYf1KpgarKMgMsDCrw%2Fuploads%2Fgit-blob-8a3553cf97aebd3a54ed46bcaffd157499c889f3%2Fwaterfall_example_conf_1.jpg?alt=media" alt=""><figcaption><p>Reshape - Waterfall input</p></figcaption></figure>

**Configuration**

```json
{
  "value_column": "revenue",
  "milestones_column": "year",
  "start": "2018",
  "end": "2019",
  "labels_column": "city",
  "sort_by": "value",
  "order": "desc",
}
```

**Output**

<figure><img src="https://1809014303-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FZxYYf1KpgarKMgMsDCrw%2Fuploads%2Fgit-blob-bd258d3434a0c2b1b75573aecb7b7fb736117401%2Fwaterfall_example_result_1.jpg?alt=media" alt=""><figcaption><p>Reshape - waterfall output</p></figcaption></figure>
