# Channel aliases

> Give a channel a different name inside one range.

A range can give a channel an [alias](https://docs.synnaxlabs.com/reference/ranges#channel-aliases): a name that applies only in that range. Use an alias to give a channel a clear name for one test, for example `tank_pressure` for the input `daq_analog_input_1`.

## Set an alias

[Enterprise](https://docs.synnaxlabs.com/reference/get-started/editions "Needs Synnax Enterprise")

**Console**

1. In the ranges toolbar, right-click a range that is saved to the Core and select **Set as active range**.
2. In the channels toolbar, right-click a channel and select **Set alias under** followed by the range name.
3. Type the alias, then press **Enter**.

The channels toolbar shows the alias while its range is active.

[](https://synnax.nyc3.cdn.digitaloceanspaces.com/docs/console/channels/alias-dark.mp4#t=0.001)

**Python**

```python
burst_test = client.ranges.retrieve(name="Oct 10 Burst Test")

burst_test.set_alias("daq_analog_input_1", "tank_pressure")

# Set several aliases at once
burst_test.set_alias({"daq_analog_input_2": "tank_temperature"})
```

**TypeScript**

```typescript
const burstTest = await client.ranges.retrieve("Oct 10 Burst Test");

await burstTest.setAlias("daq_analog_input_1", "tank_pressure");

// List the aliases of the range, keyed by channel key
const aliases = await burstTest.listAliases();
```

A [child range](https://docs.synnaxlabs.com/reference/ranges#child-ranges) uses the aliases of its parent. Set an alias on the child to replace the alias of the parent in the child.

> An alias applies only in its range. Outside of the range, Synnax does not find the channel by its alias.

## Remove an alias

[Enterprise](https://docs.synnaxlabs.com/reference/get-started/editions "Needs Synnax Enterprise")

**Console**

Make the range active. In the channels toolbar, right-click the channel and select **Remove alias under** followed by the range name. You can select several channels first.

**TypeScript**

```typescript
const channelKey = await burstTest.resolveAlias("tank_pressure");
await burstTest.deleteAlias(channelKey);
```

The Python client cannot remove an alias.

## Read by alias

[Enterprise](https://docs.synnaxlabs.com/reference/get-started/editions "Needs Synnax Enterprise")

**Python**

Use the alias as a property or a key of the range. The result is the data of the channel in the range:

```python
burst_test = client.ranges.retrieve(name="Oct 10 Burst Test")

pressure = burst_test.tank_pressure.to_numpy()
pressure = burst_test["tank_pressure"].to_numpy()

# A regular expression matches channel names and aliases
for ch in burst_test["^tank"]:
    print(ch.name, ch.to_numpy().max())
```

**TypeScript**

Resolve the alias to a channel key, then read the time range of the range:

```typescript
const burstTest = await client.ranges.retrieve("Oct 10 Burst Test");
const channelKey = await burstTest.resolveAlias("tank_pressure");
const data = await client.read(burstTest.timeRange, channelKey);
```
