I have two fields that I want to concatenate. Field1 contains null values and Field2 has values for every record. I want to concatenate only when both fields have values. I tried using a function with an
if/else statement but that doesn't work as the resulting concatenation will return values from field2.
def concat_fields(field1, field2): if field1 == "" return else: return field1 + field2
I know this is wrong. Any suggestions?