# IntegrateVariable

**URL:** https://discourse.paraview.org/t/integratevariable/8205
**Category:** ParaView Support
**Created:** [October 17, 2021, 5:39pm UTC](https://discourse.paraview.org/t/integratevariable/8205 "2021-10-17T17:39:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ncharala](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/n/a183cd/32.png) [@ncharala](https://discourse.paraview.org/u/ncharala)
#### Post date: [October 17, 2021, 5:39pm UTC](https://discourse.paraview.org/t/integratevariable/8205/1 "2021-10-17T17:39:29Z")

</div>

Hi, I am trying to find the total vapour volume of all cells with a threshold value between 0.01 and 0.95 and I did the following:

1. Used the Find Data and Run a Selection query for alpha.water between 0.01 and 0.95
2. Used the CellSize filter to find the Volume for each cell
3. Used the Calculator to calculate the vapour volume (1-alpha.water)\*Volume where Volume is the cell Volume
4. Used the filter IntegrateVariable to calculate to the sum of vapour volume.

However the number I was getting was not the same as adding the values for the vapour Volume for each cell.  
What I am doing wrong or not understanding?  
Thank you for your help

 ![paraview1](https://discourse.paraview.org/uploads/default/original/2X/1/174ec2d6fd29d93ca93cb1467d2035c3a5a88c1d.jpeg)  
 ![paraview2](https://discourse.paraview.org/uploads/default/original/2X/1/1fcd164c10d1e47fe196f0ab3c1a4ebac4dedf76.jpeg)

Nicolas

---

<div class="post-metadata">

### Author: ![hdz19900725](https://discourse.paraview.org/user_avatar/discourse.paraview.org/hdz19900725/32/7157_2.png) [@hdz19900725](https://discourse.paraview.org/u/hdz19900725)
#### Post date: [October 18, 2021, 2:07pm UTC](https://discourse.paraview.org/t/integratevariable/8205/2 "2021-10-18T14:07:45Z")

</div>

You should not use IntegrateVariable filter, you should use Python calculator filter and input the expression：sum(inputs[0].CellData[‘vapourVolume’]).  
This will calculate the sum of all vapour volume.

---

<div class="post-metadata">

### Author: ![ncharala](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/n/a183cd/32.png) [@ncharala](https://discourse.paraview.org/u/ncharala)
#### Post date: [October 18, 2021, 7:26pm UTC](https://discourse.paraview.org/t/integratevariable/8205/3 "2021-10-18T19:26:05Z")

</div>

Thank you hdz

---

<div class="post-metadata">

### Author: ![pcrepier](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/f4b2a3/32.png) [@pcrepier](https://discourse.paraview.org/u/pcrepier)
#### Post date: [October 19, 2021, 7:08am UTC](https://discourse.paraview.org/t/integratevariable/8205/4 "2021-10-19T07:08:09Z")

</div>

The integrate variable filter will work just fine for this, but you missed a subtility: during the integration, the value is multiplied by the local scalar too.  
So in your calculator, you should only use 1-alpha.water, not multiply by the cell volume. the results should then match your expectations.
