> For the complete documentation index, see [llms.txt](https://docs.marpledata.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.marpledata.com/docs/marple-insight/user-manuals/analysis/plot-types/time-series/text-data.md).

# Text data

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

<figure><img src="/files/6hQUoATHRNKRbIujB21u" 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="/files/jGXD8SLUUHBF9uy6RscM" 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
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.marpledata.com/docs/marple-insight/user-manuals/analysis/plot-types/time-series/text-data.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
