# Merging columns by sum

**URL:** <https://forum.inductiveautomation.com/t/merging-columns-by-sum/107148>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 6, 2025, 11:16pm UTC](https://forum.inductiveautomation.com/t/merging-columns-by-sum/107148 "2025-06-06T23:16:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel4](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@daniel4](https://forum.inductiveautomation.com/u/daniel4)\
**Post date:** [June 6, 2025, 11:16pm UTC](https://forum.inductiveautomation.com/t/merging-columns-by-sum/107148/1 "2025-06-06T23:16:03Z")

</div>

This is kind of a dumb problem. Because I could have solved it by a little bit of thinking in the beginning. I have a bunch of power meters that I need the combined energy readings from and show it in a table. I have all the readings saved in the historian. But didn't think to make a tag for the combined value. So my question is. Is there a way that I can get the data and add it up after the fact. (timestamps should be the same so that's not a problem).  
I know I could probably write a script that could do this. But if there is some tagHistory binding or expression magic that I'm not aware of that would be great.

Example:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/d/dd1ed12c196467aca1fe9d8721900b47f3d1a0a4.png)

---

<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:** [June 6, 2025, 11:56pm UTC](https://forum.inductiveautomation.com/t/merging-columns-by-sum/107148/2 "2025-06-06T23:56:45Z")

</div>

Are the Dataset1 and Dataset2 t\_stamps exactly as shown or are there fractions of a second in the actual values in the database?

---

<div class="post-metadata">

**Author:** ![daniel4](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@daniel4](https://forum.inductiveautomation.com/u/daniel4)\
**Post date:** [June 7, 2025, 12:01am UTC](https://forum.inductiveautomation.com/t/merging-columns-by-sum/107148/3 "2025-06-07T00:01:49Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/9/5946617ac12f2adc8cb5578d5ef245f223cfe2c0.png)  
This is how it looks in the designer

---

<div class="post-metadata">

**Author:** ![daniel4](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@daniel4](https://forum.inductiveautomation.com/u/daniel4)\
**Post date:** [June 7, 2025, 12:36am UTC](https://forum.inductiveautomation.com/t/merging-columns-by-sum/107148/4 "2025-06-07T00:36:18Z")

</div>

There is functionality that is soooo close but not quite. The sum function just needs one more overload for merge and we are golden 😃

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/8/f87f3676db8313fdcd65cf629a2019233cf4df70.png)  
I will just try my hand at a script until someone finds a better way.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 7, 2025, 12:53am UTC](https://forum.inductiveautomation.com/t/merging-columns-by-sum/107148/5 "2025-06-07T00:53:43Z")

</div>

Not possible with vanilla expressions, but I bet Phil's (free) integration toolkit could do it:

> [@Automation Professionals' Integration Toolkit Module](https://forum.inductiveautomation.com/t/automation-professionals-integration-toolkit-module/74934):
>
> Automation Professionals is pleased to announce the immediately availability of a major upgrade to its free Simulation Aids Integration Toolkit module. The new feature justifying the "major upgrade" language is the implementation of eleven thirty-one new expression functions which use iteration to accomplish complex transforms of datasets and lists, to or from other datasets and lists, applying filtering, ordering, and computed new columns along the way. While there are certain operations that…

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [June 7, 2025, 2:51pm UTC](https://forum.inductiveautomation.com/t/merging-columns-by-sum/107148/6 "2025-06-07T14:51:41Z")

</div>

> [@daniel4](#):
>
> But didn't think to make a tag for the combined value

Make it now ! Otherwise, future you will blame present you for working around the issue instead of fixing it !

---

<div class="post-metadata">

**Author:** ![daniel4](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@daniel4](https://forum.inductiveautomation.com/u/daniel4)\
**Post date:** [June 7, 2025, 6:05pm UTC](https://forum.inductiveautomation.com/t/merging-columns-by-sum/107148/7 "2025-06-07T18:05:56Z")

</div>

Yeah it was the first thing I did after noticing my blunder 😃

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [June 7, 2025, 11:47pm UTC](https://forum.inductiveautomation.com/t/merging-columns-by-sum/107148/8 "2025-06-07T23:47:56Z")

</div>

And backfill the history
