Hello, I am having issues with a Dashboard / DQL query.
I have a variable on my dashboard called $Measurement and depending on what that shows I either want to see timeseries data for P90 or Average on my graph. I have tried the below:
timeseries
value.Avg = percentile(dt.service.request.response_time, 50, default:0), interval:10m, nonempty:true,
value.P90 = percentile(dt.service.request.response_time, 90, default:0),
by: { dt.entity.service },
from: now()-1d,
to: now()
| fieldsAdd ServiceName = entityName(dt.entity.service)
| fieldsAdd Data = if($Measurement==“Average”, value.Avg, else: value.P90)
| fieldsKeep timeframe, interval, Data, ServiceName
Which gives me charting, but the numbers are wrong, as in it doesn’t seem to know that Data is nanoseconds, so it plots it as M instead of the usual default S. I have tried making the value.Avg in to seconds as it is assigned to Data, but that does not work, as I am guessing that it is the default data type of Data hasn’t taken on the timeseries format.
Any ideas please?
Or maybe I am going about this the wrong way entirely!
I have shown how the data plots on the graphs, if I do the value.Avg and value.P90 it is the bottom chart, if I just do the Data, it is the top one

