# How to update value of Cell only if its greater than the one in the last time step

**URL:** https://discourse.paraview.org/t/how-to-update-value-of-cell-only-if-its-greater-than-the-one-in-the-last-time-step/3693
**Category:** ParaView Support
**Created:** [February 28, 2020, 10:41am UTC](https://discourse.paraview.org/t/how-to-update-value-of-cell-only-if-its-greater-than-the-one-in-the-last-time-step/3693 "2020-02-28T10:41:39Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Abbas](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/22d042/32.png) [@Abbas](https://discourse.paraview.org/u/Abbas)
#### Post date: [February 28, 2020, 10:41am UTC](https://discourse.paraview.org/t/how-to-update-value-of-cell-only-if-its-greater-than-the-one-in-the-last-time-step/3693/1 "2020-02-28T10:41:39Z")

</div>

This is a bit difficult to explain so bear with me.  
I have whole bunch of particles which change position and magnitude as time passes but I only want to update the magnitude if its bigger than the last-  
i.e. I want each cell to hold the greatest magnitude it has had over the whole time series.  
I know this might be easier than I think but my current knowledge of Paraview is a bit rudimentary and I would greatly appreciate your help!

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 28, 2020, 10:43am UTC](https://discourse.paraview.org/t/how-to-update-value-of-cell-only-if-its-greater-than-the-one-in-the-last-time-step/3693/2 "2020-02-28T10:43:27Z")

</div>

PlotDataOverTime ?

---

<div class="post-metadata">

### Author: ![Abbas](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/22d042/32.png) [@Abbas](https://discourse.paraview.org/u/Abbas)
#### Post date: [March 4, 2020, 7:04am UTC](https://discourse.paraview.org/t/how-to-update-value-of-cell-only-if-its-greater-than-the-one-in-the-last-time-step/3693/4 "2020-03-04T07:04:54Z")

</div>

So I tried the plotdataovertime but I want to apply a python calculator over a timeseries for each point- i.e something like a script to update values of each cell only if the value increases.  
Would that be possible in the python calculator filter because from the little knowledge I have, I can only apply the script to deal with each timestep separately.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 4, 2020, 7:44am UTC](https://discourse.paraview.org/t/how-to-update-value-of-cell-only-if-its-greater-than-the-one-in-the-last-time-step/3693/5 "2020-03-04T07:44:38Z")

</div>

No, only in a ProgrammableFilter using CONTINUE\_EXECUTING.  
Not a trivial task if I’m being honest.

---

<div class="post-metadata">

### Author: ![Abbas](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/22d042/32.png) [@Abbas](https://discourse.paraview.org/u/Abbas)
#### Post date: [March 4, 2020, 7:51am UTC](https://discourse.paraview.org/t/how-to-update-value-of-cell-only-if-its-greater-than-the-one-in-the-last-time-step/3693/7 "2020-03-04T07:51:15Z")

</div>

I see.  
I was wondering if I can apply the temporal shift filter to shift data one timestep back and then perform the needed comparison between the two sets of data?  
Of couse this is with a rudimentary knowledge of the temporal shift filter and I would be grateful if you could guide me to any documentation of the programmableFilter.  
Cheer

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 4, 2020, 7:52am UTC](https://discourse.paraview.org/t/how-to-update-value-of-cell-only-if-its-greater-than-the-one-in-the-last-time-step/3693/8 "2020-03-04T07:52:49Z")

</div>

You can easily compare timesteps with the ForceTime and the PythonCalculator, but you will not be able to integrate over time.

---

<div class="post-metadata">

### Author: ![Abbas](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/a/22d042/32.png) [@Abbas](https://discourse.paraview.org/u/Abbas)
#### Post date: [March 4, 2020, 7:56am UTC](https://discourse.paraview.org/t/how-to-update-value-of-cell-only-if-its-greater-than-the-one-in-the-last-time-step/3693/9 "2020-03-04T07:56:54Z")

</div>

So I can do it for one step but it wont be easy to do it for all? Is that because Forcetime can only take an absolute value and not a variable one like (n-1)?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [March 4, 2020, 8:00am UTC](https://discourse.paraview.org/t/how-to-update-value-of-cell-only-if-its-greater-than-the-one-in-the-last-time-step/3693/10 "2020-03-04T08:00:55Z")

</div>

Yes.
