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

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.

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.
This are some example functions on how to convert a discrete gear
signal to a text signal direction
which indicates the driving direction:
ADX
Text to Number
iff([[direction]] == 'Reverse', -1,
iff([[direction]] == 'Neutral', 0, 1)
Number to Text
iff([[m.gear]] == 0, 'Reverse',
iff([[m.gear]] == 1, 'Neutral', 'Forward'))
PostgreSQL / TimescaleDB
Text to Number
CASE
WHEN [[direction]] = 'Reverse' THEN -1
WHEN [[direction]] = 'Neutral' THEN 0
ELSE 1
END
Number to Text
CASE
WHEN ([[gear]]::int) = 0 THEN 'Reverse'
WHEN ([[gear]]::int) = 1 THEN 'Neutral'
ELSE 'Forward'
END
Last updated