I want to place an "up arrow" or a " down arrow" before a dollar amount signifying that the price has either increased or decreased. Any suggestions on how to format this in the Label Expression builder in arcgis for desktop? Thanks

19100
7
Jump to solution
06-06-2016 03:52 PM
AndrewMartinez4
New Contributor III

I want to place an "up arrow" or a " down arrow" before a dollar amount signifying that the price has either increased or decreased. Any suggestions on how to format this in the Label Expression builder in arcgis for desktop? Thanks

0 Kudos
1 Solution

Accepted Solutions
DarrenWiens2
MVP Honored Contributor

This will add an up arrow:

...although it may be better to use the 'Advanced' option to add a more complex code block to choose the correct sign:

def FindLabel ( [NAMEPROPER], [Difference] ):
  if [Difference] > 0:
    sign = u'\u2191' # up arrow
  elif [Difference] < 0:
    sign = u'\u2193' # down arrow
  else:
    sign = '-' # no change
  return [NAMEPROPER] + '\n' + sign + [Difference]

View solution in original post

7 Replies
DanPatterson_Retired
MVP Emeritus

In python 2.x  have fun with this link Arrow symbol - Sets - Unicode® character table

>>> a = u'\u2191'

>>> print(a)

>>> print(a+"$")

↑$

EDIT

Found a more elaborate link covering all kinds of arrows

http://unicode.org/charts/PDF/U2190.pdf

DarrenWiens2
MVP Honored Contributor

I suppose it depends somewhat on your choice of font, but you can also copy/paste from the good, old Character Map. And, it's no coincidence that the code at the bottom is the same as in Dan's example.

DanPatterson_Retired
MVP Emeritus

I am all excited about the new ones coming soon... face palm is going to be popular Emoji Recently Added

AndrewMartinez4
New Contributor III

Dan,

Let me start by saying I have no python language experience so please forgive my naivety. I attempted to incorporate the code you provided to what I have already done. I failed in making it work to say the least. If you could provide the proper expression that would be great. I will then return to try understanding whats going on in the code

Thanks

Expression Builder.JPG

0 Kudos
DanPatterson_Retired
MVP Emeritus

Ok... first, I gave an example for emulation, so.. you don't need the a = part, nor the print(a) part and you seem to have square brackets around the field names... did you switch to the python parser before or after you select the field names (aka nameproper and difference) since I don't do maps, I am only familiar with the field calculator syntax which is field names enclose in exclamation marks.  so the only part you should actually type is the u'\u2191' bit and everything else you should select.  Anyone that labels or does maps can leap in at anytime

0 Kudos
DarrenWiens2
MVP Honored Contributor

This will add an up arrow:

...although it may be better to use the 'Advanced' option to add a more complex code block to choose the correct sign:

def FindLabel ( [NAMEPROPER], [Difference] ):
  if [Difference] > 0:
    sign = u'\u2191' # up arrow
  elif [Difference] < 0:
    sign = u'\u2193' # down arrow
  else:
    sign = '-' # no change
  return [NAMEPROPER] + '\n' + sign + [Difference]
AndrewMartinez4
New Contributor III

Appreciate it! Exactly what I wanted.

0 Kudos