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 '18, 11:57

beka's gravatar image

beka
185836
accept rate: 6%


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 '18, 14:39

Stefano%20%28OF%29's gravatar image

Stefano (OF) ♦♦
4.8k119
accept rate: 19%

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 '18, 12:06

Stefano%20%28OF%29's gravatar image

Stefano (OF) ♦♦
4.8k119
accept rate: 19%

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 '18, 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 '18, 14:00

beka's gravatar image

beka
185836
accept rate: 6%

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:

×494

question asked: 04 Jan '18, 11:57

question was seen: 2,782 times

last updated: 05 Jan '18, 14:39