Hi,
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.
Thank you Dan!
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
convert(2, !Zval!)
here is an example using a slightly different example... but the principle is the same.
Thank you Dan!
Perhaps you could mark this as Answered since the information Dan provides is spot on.
Joe... I think Bartosz is long gone... it get randomly bumped up the pile over time though
Ahhh good... at least the thread is closed
But awarding the answer to yourself is a bit....
I didn't... Bartosz thought his thank you was the correct answer... perhaps the final closure is solution enough
Hi guys,
Sorry for that mistake.
Its ok... the question has been getting bumped up randomly over time. At least it is closed now.