# Need help on system.tag.queryTagCalculations

**URL:** <https://forum.inductiveautomation.com/t/need-help-on-system-tag-querytagcalculations/33090>\
**Category:** Ignition\
**Created:** [March 14, 2020, 9:23am UTC](https://forum.inductiveautomation.com/t/need-help-on-system-tag-querytagcalculations/33090 "2020-03-14T09:23:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [March 14, 2020, 9:23am UTC](https://forum.inductiveautomation.com/t/need-help-on-system-tag-querytagcalculations/33090/1 "2020-03-14T09:23:38Z")

</div>

Hi  
I need some on help get the maximum value of tag when a boolean tag is true at specific time range.  
What I have is a pump with two tags:  
1 - Pump/Pressure  
2 - Pump/Run  
I want to get the minimum value of Pump/Pressure when Pump/Run = True.  
Because I use ignition historian using name query is really hard and system.tag.queryTagCalculations is much easier here but for case I don’t have any idea how use it.

---

<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:** [March 14, 2020, 2:42pm UTC](https://forum.inductiveautomation.com/t/need-help-on-system-tag-querytagcalculations/33090/2 "2020-03-14T14:42:49Z")

</div>

The tag historian doesn’t really do relationships between tags. You’ll have to script this with two queries: one with the boolean to find the relevant times, and then one for each time span with the process calculation.

Or you can use the correct tool: a transaction group that records multiple items together, letting you easily construct queries that depend on relationships/conditions between columns. In a simple case like this, you could even not record at all while Run is false.

(This sort of stuff is why I hardly ever use the tag historian.)
