---
title: "Stem number for forked tree"
url: "https://openforis.support/questions/1992/stem-number-for-forked-tree"
tags: ["collect"]
status: "answered"
score: 0
answer_count: 4
asked: "2018-11-03T08:02:09"
last_activity: "2018-11-19T09:57:18"
source: "Open Foris Support - Q&A Forum"
license: "Copyright Open Foris, 2026. Some rights reserved under creative commons license."
---

# Stem number for forked tree

Asked by Andras on 2018-11-03

Dear OF Team and Fellow Users,

how could I have a tree_id attribute being the same for all the forks of a forked tree?

Thanks!

Andras


## Answer (score 0, by Lauri (OF) on 2018-11-06)

Link: https://openforis.support/questions/1992/stem-number-for-forked-tree/1998

Dear Andras,

add two key attributes: ![alt text][1]


  [1]: http://www.openforis.org/support/upfiles/of_stem.JPG

Regards, Lauri


## Answer (score 0, by Andras on 2018-11-12)

Link: https://openforis.support/questions/1992/stem-number-for-forked-tree/2000

Dear Lauri,

I forgot to mention, that I'd like the tree ID to be automatically created. I assume the above suggestion only works, if the user records the same tree_no manually for multiple forks.

BR, Andras


## Answer (score 0, by Lauri (OF) on 2018-11-19)

Link: https://openforis.support/questions/1992/stem-number-for-forked-tree/2006

Dear Andras, 

that's correct, it works if you add tree\_no manually. A possible solution in your case would be that you set default for the first tree\_no as 1, and tree\_stem\_no as 'Not required'. And when if you add tree\_stem\_no=1 manually, next tree\_no will be set by using an expression to the same as previous tree_no. But it works not correctly after entering the last fork. 

Well, another solution from golden Fortran era: add the first field where you fill in how many forks you are going to record for a tree. Then create expression where tree\_no is replicated and tree\_stem\_no increases automatically...  

BR, Lauri


## Answer (score 0, by Andras on 2018-11-19)

Link: https://openforis.support/questions/1992/stem-number-for-forked-tree/2007

Dear Lauri,

At the and I have solved the issue by adding two Boolean attributes (one for forked vs not-forked and one for first fork vs not-first-fork) and a calculated attribute for the sum of non-first forks on the plot. With the help of these I am able to calculate both, tree\_no and tree\_stem\_no. I was hoping for a bit more simple solution.

Thanks for your comments on this all the same!

BR, Andras
