Hi,
I need help writing a formula :
I need it to say
IF ResIND = I and STARTDATE is null then INITIAL and IF ResIND & STARTDATE is NOT NULL then RESTRICT
thankS!
Solved! Go to Solution.
IF [ResIND] = 'I' And isNull([STARTDATE]) Then 'INITIAL'
ElseIf !isNull([ResIND]) And !isNull([STARTDATE]) then 'RESTRICT'
EndIF
@Hi2023 assuming initial/restrict are flags, rather than fields (please correct me if not), this ought to be something like:
IF [ResIND] = 'I' AND isNull([STARTDATE]) THEN "INITIAL"
ELSE "RESTRICT"
ENDIF
Unless you have more potential outcomes, then we'd need to use an elseif.
Hi @Hi2023
You have two options; if your only criteria is ResIND = I and StartDate is not null then you can do the below and all other records will be 'Restrict':
IF [ResIND] = "I" AND IsNull([STARTDATE])
THEN "Initial"
ELSE "Restrict"
ENDIF
Another option to make it a bit more dynamic and account for other combination is below:
IF [ResIND] = "I" AND IsNull([STARTDATE])
THEN "Initial"
ELSEIF !IsNull([ResIND]) AND !IsNull([STARTDATE])
THEN "Restrict"
ELSE "Error"
ENDIF
I've added in a 'Error' clause which you can replace with whatever you want, but it will check both specific criteria and output error if it doesn't match either.
Hope this helps!