# PipelineMovementStatisticsByPipelineId
## Documentation
The movements of deals in one pipeline over a period. Each request costs 40 tokens of the daily budget of the company.
- Catalog: `Pipedrive`
- Schema: `Pipelines`
This is a read-only table function. The Pipedrive API may not support changing the data or the Invantive UniversalSQL driver for Pipedrive does not cover it. In the latter case, please use the table NativePlatformScalarRequests to upload data to the Pipedrive API.
## Parameters of Table Function
The following parameters can be used to control the behaviour of the table function `PipelineMovementStatisticsByPipelineId`. A value must be provided at all times for required parameters, but optional parameters in general do not need to have a value and the execution will default to a pre-defined behaviour. Values can be specified by position and by name. In both cases, all parameters not specified will be evaluated using their default values.
Value specification by position is done by listing all values from the first to the last needed value. For example: a `select * from table(value1, value2, value3)` on a table with four parameters will use the default value for the fourth parameter and the specified values for the first three.
Value specification by name is done by listing all values that require a value. For example with `select * from table(name1 => value1, name3 => value3)` on the same table will use the default values for the second and fourth parameters and the specified values for the first and third.
| Name | Data Type | Required | Default Value | Documentation |
|---|:---:|:---:|:---:|---|
| `end_date` | `datetime` | ☑ | | The end date. |
| `pipeline_id` | `int64` | ☑ | | The pipeline id. |
| `start_date` | `datetime` | ☑ | | The start date. |
## Columns of Table Function
The columns of the table function `PipelineMovementStatisticsByPipelineId` are shown below. Each column has an SQL data type.
| Name | Data Type | Label | Required | Documentation |
|---|:---:|---|:---:|---|
| `average_age_in_days_across_all_stages` | `int64` | | ☐ | The moved deals average age across all stages. |
| `average_age_in_days_by_stages` | `varchar2` | | ☐ | The moved deals average age by stages. |
| `deals_left_open_count` | `int64` | | ☐ | The count of the deals. |
| `deals_left_open_deals_ids` | `varchar2` | | ☐ | The IDs of the deals that have been moved. |
| `deals_left_open_formatted_values` | `varchar2` | | ☐ | The formatted values of the deals. |
| `deals_left_open_values` | `varchar2` | | ☐ | The values of the deals. |
| `end_date` | `datetime` | | ☐ | The end date the rows were read for. |
| `lost_deals_count` | `int64` | | ☐ | The count of the deals. |
| `lost_deals_deals_ids` | `varchar2` | | ☐ | The IDs of the deals that have been moved. |
| `lost_deals_formatted_values` | `varchar2` | | ☐ | The formatted values of the deals. |
| `lost_deals_values` | `varchar2` | | ☐ | The values of the deals. |
| `movements_between_stages_count` | `int64` | | ☐ | The count of the deals that have been moved between stages. |
| `new_deals_count` | `int64` | | ☐ | The count of the deals. |
| `new_deals_deals_ids` | `varchar2` | | ☐ | The IDs of the deals that have been moved. |
| `new_deals_formatted_values` | `varchar2` | | ☐ | The formatted values of the deals. |
| `new_deals_values` | `varchar2` | | ☐ | The values of the deals. |
| `pipeline_id` | `int64` | | ☐ | The pipeline id the rows were read for. |
| `start_date` | `datetime` | | ☐ | The start date the rows were read for. |
| `won_deals_count` | `int64` | | ☐ | The count of the deals. |
| `won_deals_deals_ids` | `varchar2` | | ☐ | The IDs of the deals that have been moved. |
| `won_deals_formatted_values` | `varchar2` | | ☐ | The formatted values of the deals. |
| `won_deals_values` | `varchar2` | | ☐ | The values of the deals. |