labeling expression to calculate percentages

594
1
11-30-2011 10:39 AM
AlexGray
New Contributor
I want to use a label expression to;

   check for duplicate attributes.
  if none found calculate percentage = 100%
   if > 1 then calculate total
   divide into single attribute
  find percentage of total

not sure if this is better done through vbscript or jscript..
Has anyone done this? If so, could someone please provide me with some example code?
Thanks.
Tags (2)
0 Kudos
1 Reply
RichardFairhurst
MVP Honored Contributor
I do not think you can do this through a label expression across multiple rows of features without using a summary tool or a cursor (python or .Net) and storing the result in a field for each row through a join to the summary or from the cursor processing.  If this involves a single feature only and multiple field columns that is different, but your description sounds like you have to accumulate multiple rows to get your answer.
0 Kudos