I want to calculate Inspection Cycle Totals based on the field Inspection Cycle using python.
If Inspection Cycle in Null, then calc Inspection Cycle Totals to zero 0.
If Inspection Cycle already has a value, then calc that value into Cycle Totals.
Note: Inspection Cycle is a short integer. Inspection Cycle Total is a text field.
Thanks in advance for any assistance.
Solved! Go to Solution.
Jayanta, I have a solution. I added () around if statement. I have enclosed an image of the solution to assist the community of users.
Thanks again!
Just keep 1 variable in the function, i.e., Inspection_Cycle.
Also in your workflow, function name is different in Code Block and in Expression.
def classify(Inspection_Cycle):
Expression:
classify(!Inspection_Cycle!)
The If statement line should end with colon (:)
That's why the code (Python_fieldcalc_2.jpg) didn't run.