AnsweredAssumed Answered

Set Text Field based on various Numeric Values

Question asked by marty72 on Aug 15, 2014
Latest reply on Aug 20, 2014 by marty72

I have a data collection solution being used on an iPad. This solution collects data in order to assess a number of parameters about trees in forested areas. One of the items collected for each each tree in the assessed areas is what species it is e.g. Hard Maple, White Pine, etc. I need to populate a text field called Species_Composition that describes the percentage of that each species represents within the forested area.


The format of this field when previously filled in by hand is a follows: MH 7 PW 2 BF 1 which would represent Hard Maple 70%, White Pine 20% and Balsam Fir 10% for a total of 100%.

There are 30 different tree species that can be represented in this description but most times only 4 to 8 species will occur in an assessment area and the maximum number that will occur in this Species_Composition field will be 10 (100%). The values in the text field also have to show from largest to smallest.


I can use the data collected to calculate a % of each species that occurs in an area which I can than round to get a single digit number ( 70% - 7 ). Any trees that round to less than 10% or 1 would be dropped leaving the rest to use for populating the text field.


I am looking for some advice as to how to approach this problem. Should I attempt to do this with a number of tree variables or fields? I have read a bit about arrays and I am wondering if this would be the way to approach it?

Any help would be appreciated.