I don't have ArcGIS 10 (yet), but from I read, you need to define a function:
def classify(value, default_value):
if value in [14175,14161,14180,13459,13460,14652,14648,14647,14644]:
return '1101A-BB 300B'
elif value in [20077,20102,20106,20107,20165,20169,20170,20250,20263,20323,20327,20328,20462,20463,21871,24184,21167,21247,21248]:
return '1101A-BO'
elif value in [16708,16668,16669,16670,16698,16683,16700,16699,16709,16743,16742,16740,16739,16738,16706,16711,16701,16705,16713,16714,16693,16746]:
return '1101A-LT_314'
elif value in [21829]:
return '1205-DFM DFDS362'
# etc...
else:
return default_value
Then at the bottom (the next box), you would call the function:
classify(!sc2!, !March_Proj!)
You could try a case when expression:
case when "Column_1" is NULL then replace("Column_2",'Text2','Text1') else "Column_2" end
Using the 'or' expression, you can add multiple columns with NULL-values to the code.
case when "Column_1" is NULL or "Column_3" is NULL then replace("Column_2",'Text2','Text1') else "Column_2" end
edit:
If you want to replace NULL, forget the replace-expression (it only works for strings and NULL is no string). Try this exact code:
case when "Feature" is NULL then '12_1' else "Feature" end
Best Answer
You could create a Python function for the field calculator using the logic below (using the first record as an example:
Or as a def, this might get your further (this example assumes that you are replacing the last entry in string.
and you can run it in standalone mode for testing as shown
EDIT For clarification, when one is doing calculations in the field calculator using Python code blocks, the above code, up to and including the "return a" line is all that is needed. The rest is for running the code as a standlone program in something like Pythonwin. So that code goes in the code block when you toggle on the "show code block" checkbox. To use the above function, make the destination field active and specify the function with the input fields in the expression box. For example:
replace_item(!PRIMARYFLD!, !SECONDARYF!)
would be used assuming the two obviously named fields listed above (ie. PRIMARYFLD and SECONDARYFLD) if they existed in your table. The help files in ArcGIS also indicate that field names must be enclosed in exclamation marks, !. More information can be found in the online help for those wishing to use Python code blocks with the field calculator.