# How to calculate difference of variables in Paraview Calculator

**URL:** https://discourse.paraview.org/t/how-to-calculate-difference-of-variables-in-paraview-calculator/13892
**Category:** ParaView Support
**Created:** [February 8, 2024, 8:45am UTC](https://discourse.paraview.org/t/how-to-calculate-difference-of-variables-in-paraview-calculator/13892 "2024-02-08T08:45:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Ali1990dashti](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ali1990dashti/32/12099_2.png) [@Ali1990dashti](https://discourse.paraview.org/u/Ali1990dashti)
#### Post date: [February 8, 2024, 8:45am UTC](https://discourse.paraview.org/t/how-to-calculate-difference-of-variables-in-paraview-calculator/13892/1 "2024-02-08T08:45:29Z")

</div>

Dear Cummunity,

First and foremost, thanks for developing such great tool like Paraview.  
I am importing an exodus file (.e) containing the results of a transient simulation.  
For some of my variebles (both the Point Data and Cell Data types) I want to calculate the difference between that variable in each time step with the value at time step 1. It should give me kind of difference between each time step and time step 1. With the `calculator` I can do calculations on each variable but I could not find a way to subtract the variable from its own value at a especific time step.

I very much appreciate any help.  
Cheers

---

<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 8, 2024, 8:54am UTC](https://discourse.paraview.org/t/how-to-calculate-difference-of-variables-in-paraview-calculator/13892/2 "2024-02-08T08:54:24Z")

</div>

Hi,

Filters → TemporalArrayOperator

---

<div class="post-metadata">

### Author: ![Ali1990dashti](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ali1990dashti/32/12099_2.png) [@Ali1990dashti](https://discourse.paraview.org/u/Ali1990dashti)
#### Post date: [February 8, 2024, 9:00am UTC](https://discourse.paraview.org/t/how-to-calculate-difference-of-variables-in-paraview-calculator/13892/3 "2024-02-08T09:00:40Z")

</div>

Thanks @mwestphal ,  
I tried it and to somehow it is what I neede, but is there any other way to make the substraction dynamic? At the moment this filter explicitely asks for two time steps but I am looking for a way subtract all the existing time steps from time step 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: [February 8, 2024, 9:34am UTC](https://discourse.paraview.org/t/how-to-calculate-difference-of-variables-in-paraview-calculator/13892/4 "2024-02-08T09:34:02Z")

</div>

This can be done but it a bit more complex.

- run ParaView
- File → Open → yourFile, Apply
- Filters → ForceTime → select timestep 1 → Apply
- Select both yourFile and ForceTime in the pipeline using control
- Add a python Calculator and use an expression like:

`inputs[0].PointData["arrayName"] - inputs[1].PointData["arrayName"]`

- Apply
