# Count multiple tree diameters

 0 1 Hi everybody, I am new to openforis, how can I count multiple tree diameters. eg in a plot I want to count how many trees have a 22cm diameter and each time to add +1 when I find another one in the plot. In the end I would have for each diameter measurement the total number of trees with the same diameter. Basically its multiple counters of tree diameters. Thanks in advance, Thomas asked 26 Nov '17, 12:01 thomas1981 10●2 accept rate: 0%

 0 This kind of behavior is easiest achieved with through the Saiku analysis rather than with calculated variables (unless you want somehow to see this data while you are collecting the data through Collect Mobile, is that the case?? ) First of all you need to have a multiple entity (tree) with an attribute (diameter) which could be a number or a code attribute (with numbers). After you collect the data, import it back from Collect Mobile into Collect (Data Manager), then you can access the Saiku Analysis interface (directly from Collect, and visualize the data there (by gragging and dropping the Diameter dimension and Plot Count measure. Does this answer your question? answered 26 Nov '17, 19:03 Open Foris ♦♦ 572●5●6●13 accept rate: 8% Hi, Thank you for your quick reply. As you said I do need to see the data I collect and maybe change them, correct any bad measurements. Until this point I also figured that I need to have a multiple entity (tree) with an attribute (diameter). I believe what I am hoping to achieve is a screen in the mobile with multiple counters, one for every diameter class (only even numbers eg 4cm,6cm,8cm till 80cm). Do you think it is feasible through collect mobile? I tried this in excel in the past, with macros but excel macros won't work in either android or windows mobile... Thanks again, Thomas (27 Nov '17, 22:45) thomas1981
 0 Hi Thomas, If you want to have a list of counters per diameter class, you will have to: - create a code list called diameter_class with the values you were saying (4cm,6cm,8cm till 80cm) - create a calculated attribute of type Code inside the tree entity called tree_diam_class, using diameter_class as code list; the calculated value expressions will be: a) constant value=NA - Apply when=idm:blank(tree_diam) a) constant value=4 - Apply when=tree_diam <= 4 b) constant value=6 - Apply when=tree_diam <= 6 c) constant value=8 - Apply when=tree_diam <= 8 d) constant value=80 - Apply when=tree_diam <= 80 e) constant value=80_plus - Apply when=tree_diam > 80 - define a multiple entity with table layout at the same level of the tree entity and call it tree_diam_class_counts or whatever you want - define a key code attribute inside this entity and use the diameter_class as code list and call it diameter_class - define a calculated number attribute and call it tree_sum or similar - use this expression in the calculated value expression section: count(parent()/tree[diameter_class = \$this/parent()/diameter_class]) Basically, the expression parent()/tree will "access" the list of trees from your context node (the calculated attribute); when you put an expression inside square brackets "[]" you are "filtering" the target entities by some condition (in this case diameter_class = \$this/parent()/diameter_class that means the diameter class of the tree must be equal to the diameter class in the entity where "this" attribute is defined). I hope it's clear enough, try to experiment with it a bit and let us know if you need more support from our side. Many thanks, Open Foris Team answered 28 Nov '17, 12:27 OF Collect ♦♦ 3.1k●1●8 accept rate: 23%
 toggle preview

### Follow this question

By Email:

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

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• 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:

×387

question asked: 26 Nov '17, 12:01

question was seen: 1,116 times

last updated: 28 Nov '17, 12:27