I stuck with simple expression in field calculator in ArcGis. I hope you`ll help me. The picture below contain two fields "Zal" (Double) and "W_zal" (string). I would like to fill field "W_zal" based on "Zal". For example: if Zal > 10, W_zal is 'text', if Zal < 10 , W_zal is "text_2". I`dont know whats is wrong, brackets, spacing... I`ll be grateful for yours help.
Solved! Go to Solution.
select the python parser
and use this as the expression in the code block. I have written the example verbosely so you can follow the logic. It is always best to assign the required output and return the final value after the fact to ensure that all is correct.
def convert(val,fld): if fld > 10: val = "text" else: val = "text2" return val
and this in the expression box
here is an example using a slightly different example... but the principle is the same.