# Roling Calculation

**URL:** <https://forum.knime.com/t/roling-calculation/5730>\
**Category:** KNIME Analytics Platform\
**Created:** [November 24, 2016, 12:25pm UTC](https://forum.knime.com/t/roling-calculation/5730 "2016-11-24T12:25:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JCanelhas](https://forum-cdn.knime.com/user_avatar/forum.knime.com/jcanelhas/32/40885_2.png) [@JCanelhas](https://forum.knime.com/u/JCanelhas)\
**Post date:** [November 24, 2016, 12:25pm UTC](https://forum.knime.com/t/roling-calculation/5730/1 "2016-11-24T12:25:53Z")

</div>

Hi all How can I do some rolling calculations ? The ideia is to get something like the following table

| Data1 | Data2 | DataVal | calculated |
| row1 | x | 1 | 0 |
| row2 | y | 3 | calc(row2)=dataval(row1)-dataval(row2) |
| row3 | z | 4 | calc(row3)=dataval(row2)-dataval(row3) |
| row4 | c | 7 | calc(row4)=dataval(row3)-dataval(row4) |

Thanks !

---

<div class="post-metadata">

**Author:** ![ImNotGoodSry](https://forum-cdn.knime.com/user_avatar/forum.knime.com/imnotgoodsry/32/470_2.png) [@ImNotGoodSry](https://forum.knime.com/u/ImNotGoodSry)\
**Post date:** [November 24, 2016, 1:01pm UTC](https://forum.knime.com/t/roling-calculation/5730/2 "2016-11-24T13:01:56Z")

</div>

One quick idea is to use the **Moving Aggregation** node in combination with a **Math Formula** &nbsp;node. Please see my screenshot attached to this post.

Best,  
Marc

- [rolingcalc.png](https://www.knime.com/sites/default/files/rolingcalc.png)

---

<div class="post-metadata">

**Author:** ![JCanelhas](https://forum-cdn.knime.com/user_avatar/forum.knime.com/jcanelhas/32/40885_2.png) [@JCanelhas](https://forum.knime.com/u/JCanelhas)\
**Post date:** [November 24, 2016, 3:06pm UTC](https://forum.knime.com/t/roling-calculation/5730/3 "2016-11-24T15:06:11Z")

</div>

Top !

&nbsp;

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [June 23, 2023, 8:22pm UTC](https://forum.knime.com/t/roling-calculation/5730/4 "2023-06-23T20:22:18Z")

</div>


