# Error on use calculator

**URL:** https://discourse.paraview.org/t/error-on-use-calculator/9825
**Category:** ParaView Support
**Tags:** vtk
**Created:** [June 16, 2022, 4:34pm UTC](https://discourse.paraview.org/t/error-on-use-calculator/9825 "2022-06-16T16:34:38Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![DanielS\_13](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/d/977dab/32.png) [@DanielS\_13](https://discourse.paraview.org/u/DanielS_13)
#### Post date: [June 16, 2022, 4:34pm UTC](https://discourse.paraview.org/t/error-on-use-calculator/9825/1 "2022-06-16T16:34:38Z")

</div>

Hi, I’m new using ParaView so I don’t really know how to describe the error I got. But basically I’m trying to use the ParaView calculator and I’m getting the following error:

```auto

ERROR: In C:\glr\builds\paraview\paraview-ci\build\superbuild\paraview\src\VTK\Common\Misc\vtkExprTkFunctionParser.cxx, line 491
vtkExprTkFunctionParser (0000015B652AE810): Err: 0 Type: [Syntax Error] Msg: ERR201 - Undefined symbol: 'Field3'	Expression: (iHat*Field 3)+(jHat*Field 4)+(kHat*Field 5)

ERROR: In C:\glr\builds\paraview\paraview-ci\build\superbuild\paraview\src\VTK\Common\Misc\vtkExprTkFunctionParser.cxx, line 491
vtkExprTkFunctionParser (0000015B652AE810): Err: 0 Type: [Syntax Error] Msg: ERR201 - Undefined symbol: 'Field3'	Expression: (iHat*Field 3)+(jHat*Field 4)+(kHat*Field 5)

Warning: In C:\glr\builds\paraview\paraview-ci\build\superbuild\paraview\src\VTK\Filters\Core\vtkArrayCalculator.cxx, line 502
vtkPVArrayCalculator (0000015B767F09B0): An error occurred when parsing the calculator's function. See previous errors.

ERROR: In C:\glr\builds\paraview\paraview-ci\build\superbuild\paraview\src\VTK\Common\Misc\vtkExprTkFunctionParser.cxx, line 491
vtkExprTkFunctionParser (0000015B652AE810): Err: 0 Type: [Syntax Error] Msg: ERR201 - Undefined symbol: 'Field3'	Expression: (iHat*Field 3)+(jHat*Field 4)+(kHat*Field 5)

ERROR: In C:\glr\builds\paraview\paraview-ci\build\superbuild\paraview\src\VTK\Common\Misc\vtkExprTkFunctionParser.cxx, line 491
vtkExprTkFunctionParser (0000015B652AE810): Err: 0 Type: [Syntax Error] Msg: ERR201 - Undefined symbol: 'Field3'	Expression: (iHat*Field 3)+(jHat*Field 4)+(kHat*Field 5)

Warning: In C:\glr\builds\paraview\paraview-ci\build\superbuild\paraview\src\VTK\Filters\Core\vtkArrayCalculator.cxx, line 502
vtkPVArrayCalculator (0000015B767F09B0): An error occurred when parsing the calculator's function. See previous errors.

```

Does anyone know the reason for the error and how to solve it?

Thank you very much in advance.

OBS: If anyone wants to see the data or how I did the process, attached is the image.

 ![error](https://discourse.paraview.org/uploads/default/original/2X/7/7e374f5144fce036acb7961b3fa489512b423f36.png)

---

<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 17, 2022, 10:18am UTC](https://discourse.paraview.org/t/error-on-use-calculator/9825/2 "2022-06-17T10:18:03Z")

</div>

Hi @DanielS_13 ,

Please share your data.

Best,

---

<div class="post-metadata">

### Author: ![DanielS\_13](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/d/977dab/32.png) [@DanielS\_13](https://discourse.paraview.org/u/DanielS_13)
#### Post date: [June 17, 2022, 12:46pm UTC](https://discourse.paraview.org/t/error-on-use-calculator/9825/3 "2022-06-17T12:46:03Z")

</div>

In the case of value data, right?  
I have them attached.  
Thanks.  
[campo.txt](https://discourse.paraview.org/uploads/short-url/gX55Lcq6bBHBk0IpAbCyHeckCWB.txt) (64.5 KB)

---

<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 17, 2022, 12:48pm UTC](https://discourse.paraview.org/t/error-on-use-calculator/9825/4 "2022-06-17T12:48:58Z")

</div>

Works great here, using ParaView 5.10.1

 ![a](https://discourse.paraview.org/uploads/default/original/2X/6/687f1f802f29eb6898c89f22b4b72c9dae8a4605.png)

---

<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 17, 2022, 12:49pm UTC](https://discourse.paraview.org/t/error-on-use-calculator/9825/5 "2022-06-17T12:49:33Z")

</div>

Your expression is not correct, it should be:

`iHat*"Field 3"+jHat*"Field 4"+kHat*"Field 5"`

---

<div class="post-metadata">

### Author: ![DanielS\_13](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/d/977dab/32.png) [@DanielS\_13](https://discourse.paraview.org/u/DanielS_13)
#### Post date: [June 21, 2022, 9:23pm UTC](https://discourse.paraview.org/t/error-on-use-calculator/9825/6 "2022-06-21T21:23:15Z")

</div>

I had noticed the error later, but still, thanks a lot for the help.

---

<div class="post-metadata">

### Author: ![Luli](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/5f9b8f/32.png) [@Luli](https://discourse.paraview.org/u/Luli)
#### Post date: [February 14, 2023, 3:30pm UTC](https://discourse.paraview.org/t/error-on-use-calculator/9825/7 "2023-02-14T15:30:23Z")

</div>

Hello Mathieu

Curiously, I have been having the same issue with version 5.11.0 and followed your instructions it worked once, only. Then the error message came back up again every time I tried to upload a new table.  
In an attempt to clear this suspicion of mine about the latest version I then installed the one before last, but the problem still persists.

Here is the error message:  
Err: 0 Type: [Lexer Error] Msg: ERR004 - General token error: "V Expression: iHat\*“Vx”+jHat\*“Vy”+kHat\*“Vz”

Would you be able to give me any advice on this please?  
Thanks in advance

---

<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 14, 2023, 3:35pm UTC](https://discourse.paraview.org/t/error-on-use-calculator/9825/8 "2023-02-14T15:35:02Z")

</div>

Please share your data

---

<div class="post-metadata">

### Author: ![Luli](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/5f9b8f/32.png) [@Luli](https://discourse.paraview.org/u/Luli)
#### Post date: [February 14, 2023, 3:37pm UTC](https://discourse.paraview.org/t/error-on-use-calculator/9825/9 "2023-02-14T15:37:45Z")

</div>

[UW\_Re\_100\_16\_cel\_res.csv](https://discourse.paraview.org/uploads/short-url/5qjdMYce83CADeK4UW9X8sTEALf.csv) (23.7 KB)

---

<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 14, 2023, 3:41pm UTC](https://discourse.paraview.org/t/error-on-use-calculator/9825/10 "2023-02-14T15:41:53Z")

</div>

Here is the correct expression:

`iHat*" Vx"+jHat*" Vy"+kHat*" Vz"`

Avoiding using spaces in your header to avoid the need for quotes.

---

<div class="post-metadata">

### Author: ![Luli](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/5f9b8f/32.png) [@Luli](https://discourse.paraview.org/u/Luli)
#### Post date: [February 14, 2023, 3:59pm UTC](https://discourse.paraview.org/t/error-on-use-calculator/9825/11 "2023-02-14T15:59:10Z")

</div>

Fantastic Mathieu  
I works fine now.

I just learnt this new valuable information now.  
Will change this on my Fortran code.  
Thanks a lot!!

---

<div class="post-metadata">

### Author: ![deepakpawar2310](https://discourse.paraview.org/user_avatar/discourse.paraview.org/deepakpawar2310/32/4602_2.png) [@deepakpawar2310](https://discourse.paraview.org/u/deepakpawar2310)
#### Post date: [February 17, 2023, 7:10am UTC](https://discourse.paraview.org/t/error-on-use-calculator/9825/12 "2023-02-17T07:10:04Z")

</div>

Hi  
I am using the following error as on using the calculator (see the attached image)

I gues its an issue related to the array calculated from the calculator

 ![Screenshot from 2023-02-17 12-43-23](https://discourse.paraview.org/uploads/default/original/2X/1/11477a4997a5aecaa72d6e7dcbc97a72671d46ec.png)

---

<div class="post-metadata">

### Author: ![deepakpawar2310](https://discourse.paraview.org/user_avatar/discourse.paraview.org/deepakpawar2310/32/4602_2.png) [@deepakpawar2310](https://discourse.paraview.org/u/deepakpawar2310)
#### Post date: [February 17, 2023, 7:31am UTC](https://discourse.paraview.org/t/error-on-use-calculator/9825/13 "2023-02-17T07:31:17Z")

</div>

Following is the error

 ![Screenshot from 2023-02-17 12-35-07](https://discourse.paraview.org/uploads/default/original/2X/d/d924154c7cd376fa135aa9dd196e417eafbef6bf.png)

---

<div class="post-metadata">

### Author: ![Kenneth\_Moreland](https://discourse.paraview.org/user_avatar/discourse.paraview.org/kenneth_moreland/32/15033_2.png) [@Kenneth\_Moreland](https://discourse.paraview.org/u/Kenneth_Moreland)
#### Post date: [February 17, 2023, 1:16pm UTC](https://discourse.paraview.org/t/error-on-use-calculator/9825/14 "2023-02-17T13:16:56Z")

</div>

The calculator filter is having trouble parsing the names of your fields (e.g., `c_voro[1]`) because it is parsing the angle brackets as an array index and not finding a field named `c_voro`. You can fix the problem by wrapping your field names in quotes to tell the parser that the whole string should be taken as the variable name.

```auto
"c_voro[1]" - "c_voro[2]"

```

Note that if you add variables to your expression using the `Scalars` combo box, it will automatically add quotes around the variable name, so that can be a helpful guide on how to add your variables to the expression.

---

<div class="post-metadata">

### Author: ![deepakpawar2310](https://discourse.paraview.org/user_avatar/discourse.paraview.org/deepakpawar2310/32/4602_2.png) [@deepakpawar2310](https://discourse.paraview.org/u/deepakpawar2310)
#### Post date: [February 18, 2023, 5:59pm UTC](https://discourse.paraview.org/t/error-on-use-calculator/9825/15 "2023-02-18T17:59:18Z")

</div>

Thank you
