0
1

Hi Open Foris Team, I have a question - Can you please explain to me how to sum up the numbers in the following case: If I have the case like this: 1 1 2 2 2 2 3 3 3 4 5 5 And I want to add one representative of each number group (e.i. 1+2+3+4+5)

Thanks in advance

asked 04 Jan, 11:57

beka's gravatar image

beka
384
accept rate: 0%


Hi Beka,
Sorry, you are right, the expression won't work in this case.
We will add an extra custom math:sum function that can be used in this case, it will be available in version 3.21 of Collect (it will be released next week).
Thanks again,
Open Foris Team

permanent link

answered 05 Jan, 14:39

OF%20Collect's gravatar image

OF Collect ♦♦
1.4k4
accept rate: 16%

Hi Beka,
You can use an expression like this:
sum(idm:distinct-values(list_of_values))
where list_of_values can be provided as a multiple attribute or as an attribute inside a multiple entity, so your final expression can be:
sum(idm:distinct-values(entity_name/attribute_name))

Many thanks,
Open Foris Team

permanent link

answered 05 Jan, 12:06

OF%20Collect's gravatar image

OF Collect ♦♦
1.4k4
accept rate: 16%

Thank you very much. I tried expression like this: sum(idm:distinct-values(parent()/tree/sum_basal_area1))

And after preview, when I press "tree" Entity, the error message appears.

https://drive.google.com/drive/folders/1FUcehn5Js3LBH3w-gG9876MI-S8Yq4DM?usp=sharing

(05 Jan, 13:59) beka beka's gravatar image

Thank you very much. I tried expression like this: sum(idm:distinct-values(parent()/tree/sum_basal_area1))

And after preview, when I press "tree" Entity, the error message appears.

https://drive.google.com/drive/folders/1FUcehn5Js3LBH3w-gG9876MI-S8Yq4DM?usp=sharing

permanent link

answered 05 Jan, 14:00

beka's gravatar image

beka
384
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • 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:

×213

question asked: 04 Jan, 11:57

question was seen: 54 times

last updated: 05 Jan, 14:39