# Can't figure out how to grab a value based on a historical time

**URL:** <https://forum.inductiveautomation.com/t/cant-figure-out-how-to-grab-a-value-based-on-a-historical-time/101627>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [January 30, 2025, 4:14pm UTC](https://forum.inductiveautomation.com/t/cant-figure-out-how-to-grab-a-value-based-on-a-historical-time/101627 "2025-01-30T16:14:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BRIAN\_NUTTING1](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@BRIAN\_NUTTING1](https://forum.inductiveautomation.com/u/BRIAN_NUTTING1)\
**Post date:** [January 30, 2025, 4:14pm UTC](https://forum.inductiveautomation.com/t/cant-figure-out-how-to-grab-a-value-based-on-a-historical-time/101627/1 "2025-01-30T16:14:00Z")

</div>

Hello All,

I need to change my screen name to village idiot as I know this will be an elementary question.  
I have created dashboards on TVs on the production floor that show the operators targets vs, where they are now with production. In this case I would like to display the number of products that the previous shift produced to create some competitive spirit. The shifts (2) end at 5A and 5P. I would like to grab that number at that point in time (4:59A and 4:59P) and display it on the dashboard for the next shift and the do the same thing every shift so the active shift can always see what the previous shift produced.

Here's where the idiot comes in...  
I have no clue as to accomplish this. All of the tags have history enabled but my brain is lacking spark.  
Thanks so much for any direction that you might provide.

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [January 30, 2025, 4:17pm UTC](https://forum.inductiveautomation.com/t/cant-figure-out-how-to-grab-a-value-based-on-a-historical-time/101627/2 "2025-01-30T16:17:02Z")

</div>

Create a set of memory tags to store the previous shift's final production numbers. Configure a Gateway Scheduled Script to poll the db to get the total completed parts at the determined times (5PM and 5AM), and write those numbers to the memory tags. Display the memory tags on your dashboard.

> **[Gateway Event Scripts | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/platform/scripting/scripting-in-ignition/gateway-event-scripts#gateway-scheduled-scripts)**
>
> Gateway Event Scripts Overview

---

<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:** [January 30, 2025, 4:36pm UTC](https://forum.inductiveautomation.com/t/cant-figure-out-how-to-grab-a-value-based-on-a-historical-time/101627/3 "2025-01-30T16:36:32Z")

</div>

Use a history binding with start and end timestamps covering the previous shift. Set return mode point count == 1 and aggregation mode "LastValue".

> **[Tag History Bindings in Perspective | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/perspective/working-with-perspective-components/bindings-in-perspective/tag-history-bindings-in-perspective#aggregation-mode)**
>
> Tag History Binding

Be sure to calculate start/end timestamps with minutes, seconds, and milliseconds precisely zero.

---

<div class="post-metadata">

**Author:** ![BRIAN\_NUTTING1](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@BRIAN\_NUTTING1](https://forum.inductiveautomation.com/u/BRIAN_NUTTING1)\
**Post date:** [January 31, 2025, 2:20pm UTC](https://forum.inductiveautomation.com/t/cant-figure-out-how-to-grab-a-value-based-on-a-historical-time/101627/4 "2025-01-31T14:20:45Z")

</div>

The memory tags worked perfectly! Thank you.
