hello, i want to calculate feild using phyton if function to do the following :
if Height_Delta is greater than 0 write in the status cell " Uprise"
if Height_Delta is less than 0 write in the status cell "Downrise"
image is attached
can anyone can help with the code ?
Solved! Go to Solution.
Height_Delta = 5 # ---- example value ["Down_rise", "Up_rise"][Height_Delta > 0] 'Up_rise'
Remember to put ! marks around Height_Delta ( !Height_Delta! ) since it is a python field calculator expression
def code_block(fld) """code block isn't really needed""" return ["Down_rise", "Up_rise"][fld > 0]
but as you can see it really isn't needed