I'm starting to try and work with the advanced findlabel function in ArcMap label expression editor. I will say I'm a complete novice at this up front. Here is what I have so far:
Function FindLabel ( [SwineWeFin] , [SwineGrFin] , [SwineNurse] , [SwineGesBo] , [SwineSowLt] , [SwineGilti] , [CattleDaHl] , [CattleDaJr] , [CattleDaHf] , [CattleBeFn] , [CattleBeFe] , [CattleVeal] , [TurkeyFin] , [TurkeyPlBr] , [ChickenLBr] , [ChickenPul] ) if ( [SwineWeFin] > 0) then FindLabel = [SwineWeFin] & " WTM " if ( [SwineGrFin] > 0) then FindLabel = [SwineGrFin] & " FTM" if ( [SwineNurse] > 0) then FindLabel = [SwineNurse] & "Nursery" if ( [SwineGesBo] + [SwineSowLt] > 0) then FindLabel = [SwineGesBo] + [SwineSowLt] & "Sows" if ( [SwineGilti] > 0) then FindLabel = [SwineGilti] & " Gilts" if ( [CattleDaHl] + [CattleDaJr] + [CattleDaHf] + [CattleBeFn] + [CattleBeFe] + [CattleVeal] > 0) then FindLabel = "Cows" if ( [TurkeyFin] + [TurkeyPlBr] > 0) then FindLabel = "Turkey" if ( [ChickenLBr] + [ChickenPul] > 0) then FindLabel = "Chickens" End Function
This mess actually kind of works for me. The problem that I have is if two of the "if' criteria apply to the same point. Currently the label will only show the first criteria that is found to be true. I want all criteria that are true to be shown as a label. I would perfer if it showed each TRUE item on a new line for the label.
Is what I'm wanting to do even possible? And if so how would I script it? Thanks!!!!