Formula modification

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

Screenshot 2024-09-06 125616

1 Like