# Step: Rename

## Overview

The **Rename** step changes the name of an existing variable.

#### Example starting data:

```
/*---------+--------*
 | student | score  |
 +---------+--------+
 | jane    | 83     |
 | neal    | 35     |
 | sam     | 74     |
 | pat     | 62     |
 *---------+--------*/
```

#### Example output data:

Rename `score` to `final_score`

```
/*---------+--------------*
 | student | final_score  |
 +---------+--------------+
 | jane    | 83           |
 | neal    | 35           |
 | sam     | 74           |
 | pat     | 62           |
 *---------+--------------*/
```

## Step structure

<figure><img src="https://1672950126-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LVodLwUXgJUGcm5Cvso%2Fuploads%2FhLNCOFoWv4RPEl8UKZji%2FScreenshot%202023-05-04%20at%2011.12.25%20AM.png?alt=media&#x26;token=96461312-7b13-4336-8110-069f8e2aa93e" alt=""><figcaption></figcaption></figure>

* There will be at least one rename block where you will define a variable and a new name.

## Input field definitions

<table><thead><tr><th width="228">Field</th><th>Definition</th></tr></thead><tbody><tr><td><strong>Source variable</strong></td><td>The variable that you want to rename.</td></tr><tr><td><strong>New name</strong></td><td>The name that your selected <code>source variable</code> will be given.<br><br>Note that this input needs to follow Redivis variable <a href="../../../tables/variables#characteristics">naming constraints</a>.</td></tr></tbody></table>

## Example

We can change the name of a variable to give more meaning to the data.

#### Starting data:

```
/*---------+-------+---------+------------*
 | test    | score | student | date       |
 +---------+-------+---------+------------+
 | quiz    | 83    | jane    | 2020-04-01 |
 | quiz    | 35    | pat     | 2020-04-01 |
 | quiz    | 89    | sam     | 2020-04-01 |
 | midterm | 74    | jane    | 2020-05-01 |
 | midterm | 62    | pat     | 2020-05-01 |
 | midterm | 100   | sam     | 2020-05-01 |
 | final   | 77    | jane    | 2020-06-01 |
 | final   | 59    | pat     | 2020-06-01 |
 | final   | 100   | sam     | 2020-06-01 |
 *---------+-------+---------+------------*/
```

#### Input fields:

<figure><img src="https://1672950126-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LVodLwUXgJUGcm5Cvso%2Fuploads%2FKj2Fvbq5qtqb6nS7ATUi%2FScreenshot%202023-05-04%20at%2011.13.05%20AM.png?alt=media&#x26;token=6a452647-492e-4dce-9986-24ba69dc5c29" alt=""><figcaption></figcaption></figure>

* **Source variable:** The variable we want to rename is `date` so we select that here.
* **New name:** `date_taken` would be a better name for this variable, so we enter it here.

#### Output data:

```
/*---------+-------+---------+------------*
 | test    | score | student | date_taken |
 +---------+-------+---------+------------+
 | quiz    | 83    | jane    | 2020-04-01 |
 | quiz    | 35    | pat     | 2020-04-01 |
 | quiz    | 89    | sam     | 2020-04-01 |
 | midterm | 74    | jane    | 2020-05-01 |
 | midterm | 62    | pat     | 2020-05-01 |
 | midterm | 100   | sam     | 2020-05-01 |
 | final   | 77    | jane    | 2020-06-01 |
 | final   | 59    | pat     | 2020-06-01 |
 | final   | 100   | sam     | 2020-06-01 |
 *---------+-------+---------+------------*/
```
