---
title: "Summing based on multiple attribute filtering"
url: "https://openforis.support/questions/3772/summing-based-on-multiple-attribute-filtering"
tags: ["arena"]
status: "accepted"
score: 0
answer_count: 2
asked: "2023-08-17T17:52:09"
last_activity: "2023-08-18T03:31:45"
source: "Open Foris Support - Q&A Forum"
license: "Copyright Open Foris, 2026. Some rights reserved under creative commons license."
---

# Summing based on multiple attribute filtering

Asked by Rajkumar on 2023-08-17

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


## Accepted answer (score 1, by Stefano (OF) on 2023-08-17)

Link: https://openforis.support/questions/3772/summing-based-on-multiple-attribute-filtering/3773

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


## Answer (score 0, by Rajkumar on 2023-08-18)

Link: https://openforis.support/questions/3772/summing-based-on-multiple-attribute-filtering/3774

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