# Best method to display all values greater than x in a certain period?

**URL:** <https://forum.inductiveautomation.com/t/best-method-to-display-all-values-greater-than-x-in-a-certain-period/31973>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [February 5, 2020, 10:50pm UTC](https://forum.inductiveautomation.com/t/best-method-to-display-all-values-greater-than-x-in-a-certain-period/31973 "2020-02-05T22:50:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rpavlicek](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rpavlicek/32/55868_2.png) [@rpavlicek](https://forum.inductiveautomation.com/u/rpavlicek)\
**Post date:** [February 5, 2020, 10:50pm UTC](https://forum.inductiveautomation.com/t/best-method-to-display-all-values-greater-than-x-in-a-certain-period/31973/1 "2020-02-05T22:50:35Z")

</div>

What would be the best way, for example, to display all tanks in which their temperature was 150 degrees and higher over the last 24 hours. This could then give a report of something and a bonus would be a showing which time periods it was 150 degrees and over. These are all actively in historian and have a similar tag structure with only a single indirect parameter differentiating them.  
I’ve been racking my brain if this would be something done in a Report, Named query, or Transaction group, etc…? Thanks

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [February 6, 2020, 2:27am UTC](https://forum.inductiveautomation.com/t/best-method-to-display-all-values-greater-than-x-in-a-certain-period/31973/2 "2020-02-06T02:27:41Z")

</div>

Don’t know if its the best way. But, I would do it with the reporting module using nested queries using named queries.

---

<div class="post-metadata">

**Author:** ![rpavlicek](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rpavlicek/32/55868_2.png) [@rpavlicek](https://forum.inductiveautomation.com/u/rpavlicek)\
**Post date:** [February 6, 2020, 3:10pm UTC](https://forum.inductiveautomation.com/t/best-method-to-display-all-values-greater-than-x-in-a-certain-period/31973/3 "2020-02-06T15:10:42Z")

</div>

I was thinking along those lines. I was trying to do a tag historian query which has all the built in power to span over all the tables (we have history split by months), then somehow query that query. But I don’t think that’s what nested queries do, I’m having trouble getting that to work.

---

<div class="post-metadata">

**Author:** ![wking](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/wking/32/21823_2.png) [@wking](https://forum.inductiveautomation.com/u/wking)\
**Post date:** [February 6, 2020, 3:15pm UTC](https://forum.inductiveautomation.com/t/best-method-to-display-all-values-greater-than-x-in-a-certain-period/31973/4 "2020-02-06T15:15:42Z")

</div>

The sub-query would be part of the nested query. If you don’t have someone who can write a query like that handy. Maybe you could do your Tag History Query then dump that into a data-set param. But, that might come with its own problem set. Say, if they are to large or what-not.

The best thing I ever did was concentrate on learning SQL properly.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 6, 2020, 3:46pm UTC](https://forum.inductiveautomation.com/t/best-method-to-display-all-values-greater-than-x-in-a-certain-period/31973/5 "2020-02-06T15:46:10Z")

</div>

Consider using your tag historian query to collect all the raw data you need, then use a script data source to reprocess that data into the nested data keys you need. Your report's charts and tables (and/or nested tables) would use the reprocessed data. This post might help you:

> [@Report with Scripted Nested Data](http://forum.inductiveautomation.com/t/report-with-scripted-nested-data/11801):
>
> The report datasource scripting examples explain how to access the nested data in another key for use constructing a custom dataset. What I don’t see is how to construct nested data that would be suitable for use with a child table in a table group. I have a parent dataset that I’m constructing via script due to annoying limitations of an ancient SQL Server 2000 instance. I need a subquery for each row that could be done with a normal query, but there’s no way to add a regular subquery to a s…
