# How to create a global variable?

**URL:** https://discourse.paraview.org/t/how-to-create-a-global-variable/4492
**Category:** ParaView Support
**Created:** [June 3, 2020, 1:32pm UTC](https://discourse.paraview.org/t/how-to-create-a-global-variable/4492 "2020-06-03T13:32:58Z")
**Posts on this page:** 1
**Showing post:** 8

<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: [June 4, 2020, 5:47am UTC](https://discourse.paraview.org/t/how-to-create-a-global-variable/4492/8 "2020-06-04T05:47:39Z")

</div>

This is called a Python Calculator.

Sadly the python calculator cannot compute a “global” FieldData.  
In order to do that, you can :

- Use the `AddFieldArrays` filter, but you need to have a file containing a field data to provide, not very practical
- Use a `Python Programmable Filter`, which would require you to learn a little bit of Python, see here for examples : [https://www.paraview.org/Wiki/Python\_Programmable\_Filter](https://www.paraview.org/Wiki/Python_Programmable_Filter)

That being said, I think that it should be possible to create single tuple field data arrays in the calculator and the python calculator, please feel free to open a issues on our gitlab : [https://gitlab.kitware.com/paraview/paraview/-/issues](https://gitlab.kitware.com/paraview/paraview/-/issues)

---

_[View the full topic](https://discourse.paraview.org/t/how-to-create-a-global-variable/4492)._
