# Sum different attributes

 0 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 asked 22 Jan '18, 10:03 itzam 21●4 accept rate: 0% Open Foris ♦♦ 473●5●6●12

 0 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 answered 22 Jan '18, 13:07 OF Collect ♦♦ 2.7k●1●8 accept rate: 22%
 0 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 answered 22 Jan '18, 13:24 itzam 21●4 accept rate: 0%
 0 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 answered 22 Jan '18, 13:38 OF Collect ♦♦ 2.7k●1●8 accept rate: 22%
 0 Yes that worked perfectly. Thanks a lot, itzam answered 22 Jan '18, 14:13 itzam 21●4 accept rate: 0%
 toggle preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

Question tags:

×47

question asked: 22 Jan '18, 10:03

question was seen: 849 times

last updated: 22 Jan '18, 14:13