How to modify this code so the values are visible only when $Type == “variable”, please see the attachment
previous_record = PREVIOUS(rec, order_by=None)
if $id == 1:
return 1
if $Type == "variable":
return previous_record.pNum + 1
else:
return previous_record.pNum