How to convert a numeric column into a label?

I have a table in below format and using Timeseries panel

(Timestamp:datetime, standarddev: float, value: float, name: string)

I want to convert the standarddev into scientific notation and into a label so that the legend looks like below,

value {name="Test", standarddev="1.000E3"}

How can I do?

What kind of data source is it? Could you please provide some obfuscated data samples as csv?

Timestamp,standarddev,value,name
2022-05-06 13:00:00,1.0009,23.4,'Darth Grafini'

Sure. I am unable to share the data as csv. So, I will try to give a sample as you have shared.

Timestamp,standarddev,value,name
2022-05-06 13:00:00,1.118,1.0,'TempAtMax'
2022-05-06 13:00:10,1.118,2.0,'TempAtMax'
2022-05-06 13:00:20,1.118,3.0,'TempAtMax'
2022-05-06 13:00:30,1.118,4.0,'TempAtMax'

So, in the legend, I want,

value {name="TempAtMax", standarddev="1.118E0"}

I am using Azure Data Explorer. If the standarddev is a string, it works. However, I want to visualize it in scientific notation and Azure data explore don’t support formatting numbers.

1 Like

That is inline csv :smile: csv does not have to be a file you share. What you provided is perfect useable csv

You could use the “Rename by regex” transform. It wouldn’t be a general/scalable solution since you would need to add an explicit transform for each case/exponent, but if the range of the stdev values is only a couple of orders of magnitude, than it’s probably sufficient.

For example, for this data we get:

by using these transforms (for the cases of E0, E1, E-2):

Note that the order of the transforms is important - you need to have the more specific ones first.

2 Likes