---
title: "How can I calculate the difference between two values"
url: "https://openforis.support/questions/2062/how-can-i-calculate-the-difference-between-two-values"
tags: ["collect", "collectearth"]
status: "accepted"
score: 0
answer_count: 3
asked: "2018-12-11T22:55:54"
last_activity: "2018-12-12T11:38:41"
source: "Open Foris Support - Q&A Forum"
license: "Copyright Open Foris, 2026. Some rights reserved under creative commons license."
---

# How can I calculate the difference between two values

Asked by ormserdar on 2018-12-11

Dear Sirs,

I could not solve the problem in the picture I shared on the link.

Thanks already for your help...

Regards,

https://drive.google.com/file/d/1FqoZz8sdt0okrGGS-pBxd1abZJ6r2gE7/view?usp=sharing


## Accepted answer (score 0, by Open Foris on 2018-12-12)

Link: https://openforis.support/questions/2062/how-can-i-calculate-the-difference-between-two-values/2064

Hi, 

Some more help.

I have created a very simple survey with only three attributes (all real number). One of them is a calculated attribute.

You can download and import the test survey here : [DOWNLOAD COLLECT FILE][1]

When you set the calculated expression make sure to leave a space  between the names of the attributes and the minus sign!

![alt text][2]


  [1]: https://drive.google.com/file/d/1SEnFS_gbPE6ACWGP5p-Vb6Z41mjlfEMt/view?usp=sharing
  [2]: http://www.openforis.org/support/upfiles/chrome_2018-12-12_09-08-41.png


## Answer (score 0, by Stefano (OF) on 2018-12-12)

Link: https://openforis.support/questions/2062/how-can-i-calculate-the-difference-between-two-values/2063

Dear user,  
Try to write in your calculated value expression just something like this:  
**fnl - int**  
You don't need to write anything else. If you want you can specify in the "Apply when" condition something like `fnl > 0` and add another "row" among the calculated values to default the value to 0 if this condition is not applied.   
Thanks,  
Open Foris Team


## Answer (score 0, by ormserdar on 2018-12-12)

Link: https://openforis.support/questions/2062/how-can-i-calculate-the-difference-between-two-values/2065

Problem solved! 
Thank you very much for your answers!
