Static Value On A Reporting XY Chart

I am making a report with an XY chart and I am pulling data from SQL. I want to add a static line to the trend that is not in my data from SQL. Anyone have an idea how to add a static line to a trend?

Retrieve it from your SQL.

SELECT 
    Timestamp,
    LineSpeed,
    20 AS LowerLimit,
    28 AS UpperLimit
FROM SpeedLog
ORDER BY Timestamp
1 Like

You will have to forgive me I have very little SQL experience and I don't know what your code is doing. Here is my current SQL select query the pulls in my data.

select * from StackTemps2
where {StartDate} < Timestamp and {EndDate} > Timestamp

What would need to be done to this query to create a static valve?

My query would return four columns of data from the SpeedLog table. It would arrive in the format,

Timestamp Linespeed LowerLimit UpperLimit
2024-02-09 08:00:00 22 20 28
2024-02-09 09:00:00 27 20 28
2024-02-09 10:00:00 19 20 28

You would then bind the X-Axis to the Timestamp column and bind three plots to the other three columns. The lower and upper limit plots will give you straight lines for your limits.


Your query would look something like

SELECT 
    Timestamp,
    Temperature,
    20 AS LowerLimit,
    28 AS UpperLimit
FROM StackTemps2
WHERE Timestamp >= {StartDate} 
  AND Timestamp < {EndDate}

Note that I've specified the fields required rather than use the * wildcard.
Usually we want the records including the StartDate so use >= but not including the start of the next period and so we usually use < for that. Be aware of the differences and modify your code to suit.

Thanks for the explanation and examples. I got the line I needed.

1 Like