# How to subtract tag from tag and store as historian variable

**URL:** <https://forum.inductiveautomation.com/t/how-to-subtract-tag-from-tag-and-store-as-historian-variable/88571>\
**Category:** Maker\
**Created:** [April 9, 2024, 11:16am UTC](https://forum.inductiveautomation.com/t/how-to-subtract-tag-from-tag-and-store-as-historian-variable/88571 "2024-04-09T11:16:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vidar\_Hetlelid](https://avatars.discourse-cdn.com/v4/letter/v/dfb087/32.png) [@Vidar\_Hetlelid](https://forum.inductiveautomation.com/u/Vidar_Hetlelid)\
**Post date:** [April 9, 2024, 11:16am UTC](https://forum.inductiveautomation.com/t/how-to-subtract-tag-from-tag-and-store-as-historian-variable/88571/1 "2024-04-09T11:16:05Z")

</div>

Hi there,

I'm reading 2 tags, which I want to subtract val\_A from val\_B, and store the result as historian so that I make a graph from the last hour. How can I achieve this?

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [April 9, 2024, 11:20am UTC](https://forum.inductiveautomation.com/t/how-to-subtract-tag-from-tag-and-store-as-historian-variable/88571/2 "2024-04-09T11:20:51Z")

</div>

Expression tag with historian enabled.

> **[Types of Tags | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/platform/tags/types-of-tags#expression-tags)**
>
> There are many different types of Tags in Ignition: standard Tags, System Tags, and Vision Client Tags. All these Tag types are available in the Tag Browser.

---

<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:** [April 9, 2024, 11:21am UTC](https://forum.inductiveautomation.com/t/how-to-subtract-tag-from-tag-and-store-as-historian-variable/88571/3 "2024-04-09T11:21:24Z")

</div>

Create an expression tag and set the expression to something like,  
`{[~]Val_B} - {[~]Val_A}`
