---
title: "Sum different attributes"
url: "https://openforis.support/questions/1592/sum-different-attributes"
tags: ["openforis"]
status: "answered"
score: 0
answer_count: 4
asked: "2018-01-22T10:03:42"
last_activity: "2018-01-22T14:13:30"
source: "Open Foris Support - Q&A Forum"
license: "Copyright Open Foris, 2026. Some rights reserved under creative commons license."
---

# Sum different attributes

Asked by itzam on 2018-01-22

Hi colleagues,

I would like your help on the above.

I want to sum different attributes (number attributes) e.g. total cover_1, total cover_2, in my survey, in order afterwards to create a validation rule (e.g. total cover (i.e. total cover_1+total cover_2) <=100%). Could you advice how this summing can be done?

Those attributes (total cover_1, total cover_2) are found in different tabs of the survey, and are the result of the sum of other attributes as part of multiple entities (1/N). Just to note that the sum of the respective attributes (e.g. total cover_1) has been done successfully.

Thanks in advance,
itzam


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

Link: https://openforis.support/questions/1592/sum-different-attributes/1593

Hi Itzam,  
You can of course use other calculated attributes as source of a calculated attribute, so in general there are no problems.  
Can you give us some more information about the structure of your survey? E.g. are total_cover_1 and total_cover_2 in the same level as total_cover? Are they inside some other single or multiple entities?  
Many thanks,  
Open Foris Team


## Answer (score 0, by itzam on 2018-01-22)

Link: https://openforis.support/questions/1592/sum-different-attributes/1594

Hi again and thanks for your prompt response,

Yes of course I can give you more info (I will try to explain as detailed as possible).

Total_cover has not been developed;

Total_cover_1 and total_cover_2 are in the same level, having the plot as a root (i.e. plot/total_cover_1, plot/total_cover_2), although appearing in different tabs. Total_cover_1, and total_cover_2 calculate the sum(using the sum function) of other attributes being part of multiple entities (1/N) (e.g. element_type_1 the total_cover_1, and element_type 2 the total_cover_2). Element_type_1 and 2 are also in the same level.

I hope this helped,

Many thanks again,
itzam


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

Link: https://openforis.support/questions/1592/sum-different-attributes/1595

Hi Itzam,  
Then just define total_cover using an expression like `total_cover_1 + total_cover_2`.  
Collect will first calculate the result of `total_cover_1` and `total_cover_2`, then it will sum up them to calculate `total_cover`.  
Please try it and let us know, many thanks.  
Open Foris Team


## Answer (score 0, by itzam on 2018-01-22)

Link: https://openforis.support/questions/1592/sum-different-attributes/1596

Yes that worked perfectly.

Thanks a lot,

itzam
