# Static Value On A Reporting XY Chart

**URL:** <https://forum.inductiveautomation.com/t/static-value-on-a-reporting-xy-chart/85092>\
**Category:** Ignition\
**Tags:** ignition79, reporting\
**Created:** [February 1, 2024, 2:19pm UTC](https://forum.inductiveautomation.com/t/static-value-on-a-reporting-xy-chart/85092 "2024-02-01T14:19:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![koenigs.alex](https://avatars.discourse-cdn.com/v4/letter/k/919ad9/32.png) [@koenigs.alex](https://forum.inductiveautomation.com/u/koenigs.alex)\
**Post date:** [February 1, 2024, 2:19pm UTC](https://forum.inductiveautomation.com/t/static-value-on-a-reporting-xy-chart/85092/1 "2024-02-01T14:19:51Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [February 1, 2024, 3:44pm UTC](https://forum.inductiveautomation.com/t/static-value-on-a-reporting-xy-chart/85092/2 "2024-02-01T15:44:38Z")

</div>

Retrieve it from your SQL.

```auto
SELECT 
    Timestamp,
    LineSpeed,
    20 AS LowerLimit,
    28 AS UpperLimit
FROM SpeedLog
ORDER BY Timestamp

```

---

<div class="post-metadata">

**Author:** ![koenigs.alex](https://avatars.discourse-cdn.com/v4/letter/k/919ad9/32.png) [@koenigs.alex](https://forum.inductiveautomation.com/u/koenigs.alex)\
**Post date:** [February 9, 2024, 12:27pm UTC](https://forum.inductiveautomation.com/t/static-value-on-a-reporting-xy-chart/85092/3 "2024-02-09T12:27:37Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [February 9, 2024, 12:46pm UTC](https://forum.inductiveautomation.com/t/static-value-on-a-reporting-xy-chart/85092/4 "2024-02-09T12:46:13Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![koenigs.alex](https://avatars.discourse-cdn.com/v4/letter/k/919ad9/32.png) [@koenigs.alex](https://forum.inductiveautomation.com/u/koenigs.alex)\
**Post date:** [February 9, 2024, 4:05pm UTC](https://forum.inductiveautomation.com/t/static-value-on-a-reporting-xy-chart/85092/5 "2024-02-09T16:05:54Z")

</div>

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