Dear OFT,

I had to calculate a sum using an attribute from a child table and apply it to the parent table. Stefano Ricci suggested the following expression sum(spl.stand[species == '1'].treevolume). This approach started working as intended, summing values based on the filtered species where the code is 1. Now, I am aiming to perform a similar sum operation using multiple attribute filters. it will help me greatly to reduce creating extra fields(attribute). I've tried a script like this: sum(spl.stand[species == '1'][starta == 'tree'].treevolume). However, this script exhibits the same behavior as before. It neither displays any incorrect syntax nor generates any output; instead, it hangs indefinitely, preventing me from progressing to the next page. I am unsure whether my script sum(spl.stand[species == '1'][starta == 'tree'].treevolume) is in an incorrect format or if it's not permissible to filter based on multiple attributes, or if there's another issue altogether. I would greatly appreciate your expert suggestions to resolve this matter. Thank you in advance. -Rajkumar Rimal

asked 17 Aug, 17:52

Rajkumar's gravatar image

accept rate: 3%

Dear Rajkumar,
You can combine multiple filters using the and "&&" and or "||" logical operators.
For example, your expression can be something like:

sum(spl.stand[species == '1' && strata == 'tree'].treevolume)

Let us know if it works for you, many thanks.
Open Foris Team

permanent link

answered 17 Aug, 22:29

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

Stefano (OF) ♦♦
accept rate: 20%

Thank you very much. It is working fine. It means we can use multiple fields to filter. Thank you again.

permanent link

answered 18 Aug, 03:31

Rajkumar's gravatar image

accept rate: 3%

Your answer
toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 17 Aug, 17:52

question was seen: 86 times

last updated: 18 Aug, 03:31