# 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="/files/iXrUkqYsWab33sUTIng1" 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="/files/qGdFRwJvi8f2OFUW2kIO" alt=""><figcaption><p>Reshape - waterfall output</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-v3.toucantoco.com/data-management-in-datahub/datasets-in-toucan/preparing-data/overview-of-youprep-tm/reshape/waterfall.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
