# Text data

You can recognize text signals by their `Text` datatype.

<figure><img src="https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2FcNRbCdd2aH1U8u0RuG4k%2Fimage.png?alt=media&#x26;token=6c9d38f5-11fa-46f6-894d-ae2813e8c0cd" alt=""><figcaption></figcaption></figure>

Text signals can be added to time series plots. They will not show up as an extra line on the plot but their value at the cursor is displayed along with the other cursor values. &#x20;

<figure><img src="https://3590686807-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwEBNWlmdcxXBXd7oyqyR%2Fuploads%2FyFCabczBD3yhiDpqn7Ea%2Fimage.png?alt=media&#x26;token=3a0fbdc2-8248-47b0-b82c-a6a63edb4805" alt=""><figcaption></figcaption></figure>

## Converting between Number and Text signals

If you want to visualize how the text signal evolves over time, you can create a function to convert the different text values to numbers and plot this function. Similar formulas can be used to create a text signal from a discrete numeric signal. Depending on you database type, this function will look different.&#x20;

This are some example functions on how to convert a discrete `gear` signal to a text signal `direction`which indicates the driving direction:

### ADX&#x20;

Text to Number

```kusto
iff([[direction]] == 'Reverse', -1,
iff([[direction]] == 'Neutral', 0, 1)
```

Number to Text

```kusto
iff([[m.gear]] == 0, 'Reverse', 
iff([[m.gear]] == 1, 'Neutral', 'Forward'))
```

### PostgreSQL / TimescaleDB

Text to Number

```sql
CASE
    WHEN [[direction]] = 'Reverse' THEN -1
    WHEN [[direction]] = 'Neutral' THEN 0
    ELSE 1
END
```

Number to Text&#x20;

```sql
CASE
    WHEN ([[gear]]::int) = 0 THEN 'Reverse'
    WHEN ([[gear]]::int) = 1 THEN 'Neutral'
    ELSE 'Forward'
END
```
