---
title: "Is it possible to filter a set of items based on some attribute?"
url: "https://openforis.support/questions/30/is-it-possible-to-filter-a-set-of-items-based-on-some-attribute"
tags: ["collect"]
status: "accepted"
score: 0
answer_count: 1
asked: "2014-10-09T20:52:17"
last_activity: "2014-10-09T21:34:30"
source: "Open Foris Support - Q&A Forum"
license: "Copyright Open Foris, 2026. Some rights reserved under creative commons license."
---

# Is it possible to filter a set of items based on some attribute?

Asked by Andras on 2014-10-09

Hi!

I would like to check the amount of trees measured with a DBH less than 20 cm in my survey for sample tree selection purposes. Is this possible in Collect?

Thanks!


## Accepted answer (score 0, by Stefano (OF) on 2014-10-09)

Link: https://openforis.support/questions/30/is-it-possible-to-filter-a-set-of-items-based-on-some-attribute/35

Yes sure. Suppose that you have for example a biophisycal survey structured like cluster -> plot -> tree and you have an attribute "dbh" inside the "tree" entity, then you can select the trees that have a DBH greater than 20 with this expression:
**tree[dbh > 20]**. 


----------


Don't forget that the expressions will be evaluated considering the parent entity current schema node as "context", so the expression written before is valid if it's defined inside a attribute contained into the "plot" entity (the context will be "plot"). Instead, if you want to use it in an attribute defined inside the "tree" entity, the expression will become: **parent()/tree[dbh > 20]**.
Thanks
