# STRETCH_CURVE
URL: https://docs.valsight.ai/stretch-curve/
Description: Stretches the curve or curves defined in the curves input over the X axis by a factor defined in the stretch input.
**Category:** [Rollforward & time series](/rollforward-time-series/)

## Overview

The **STRETCH\_CURVE** function **stretches the curve or curves defined in the curves input over the X axis by a factor** defined in the stretch input.

You can specify the X coordinate where the stretching begins with the optional start input. The stretching begins at 0 by default. The X coordinates are represented by the `Sequence` level in the curves input, and the Y coordinates are represented by the values of the curves input.

Use this function when you want to stretch or compress an existing profile along the time axis instead of only delaying it.

## Syntax

`STRETCH_CURVE('CurvesNode', 'StretchNode' [, 'StartNode'])`

## Parameters

| Parameter       | Description                                                                                                                                                                                              | Type                     | Required | Default |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | -------- | ------- |
| **CurvesNode**  | Definition of curves as a set of `(X, Y)` points in the coordinate system. X values are taken from the `Sequence` level and Y values from the node values. This input must contain the `Sequence` level. | Node reference           | Yes      | --      |
| **StretchNode** | Stretch factor. It must not contain the `Sequence` level and may only contain levels that are also present in `CurvesNode`. It can also be a constant.                                                   | Node reference or number | Yes      | --      |
| **StartNode**   | X coordinate where stretching begins. It must not contain the `Sequence` level and may only contain levels that are also present in `CurvesNode`. It can also be a constant.                             | Node reference or number | No       | `0`     |

## Example

### Stretching project-specific curves with an optional start point

This example shows two input curves, one for project A and one for project B. Each project uses its own stretch factor, and only project B receives an explicit start point; project A therefore defaults to `0`.

**Input node:** `'CurvesNode'`

| Project | Sequence | Value |
| ------- | -------- | ----- |
| A       | 0        | 0     |
| A       | 1        | 1     |
| A       | 2        | 1     |
| A       | 3        | 2     |
| B       | 0        | 0     |
| B       | 1        | 1     |
| B       | 2        | 2     |

**Input node:** `'StretchNode'`

| Project | Value |
| ------- | ----- |
| A       | 1.5   |
| B       | 2     |

**Input node:** `'StartNode'`

| Project | Value |
| ------- | ----- |
| B       | 2     |

**Formula:** `STRETCH_CURVE('CurvesNode', 'StretchNode', 'StartNode')`

| Project | Sequence | STRETCH\_CURVE Result |
| ------- | -------- | --------------------- |
| A       | 0        | 0                     |
| A       | 1        | 0.67                  |
| A       | 2        | 1                     |
| A       | 3        | 1                     |
| A       | 4        | 1.67                  |
| A       | 5        | 2                     |
| B       | 0        | 0                     |
| B       | 1        | 1                     |
| B       | 2        | 1.33                  |
| B       | 3        | 1.67                  |
| B       | 4        | 2                     |

## Related

| Function                               | When to use instead                                                                                                                          |
| -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| [TIMELAG](/timelag/)                   | When you want a delayed effect at a chosen time granularity instead of stretching or compressing an existing profile.                        |
| [SCHEDULEPROJECTS](/scheduleprojects/) | When you want to place project blueprints onto actual start periods instead of reshaping an already defined profile along the sequence axis. |
