Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7377 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I need to do the following type of logic:

IF AAA = "XXX" AND:

IF B <> "" then X = B

IF C <> "" then X = C

etc.

ENDIF

IF BBB = "XXX" AND:

IF B <> "" then Y = B

IF C <> "" then Y = C

etc.

ENDIF

Is there a good way to nest IF statements? If so, please give an example of the FMP code needed. TIA

Posted

I'm assuming you're referring to the If script step and not the If calculation function. If I'm correct, then you want something that looks like

If [AAA = "XXX"]

If [not IsEmpty(:]

Set Field [X; B]

Else If [not IsEmpty©]

Set Field [X; C]

etc.

End If

End If

End If

If you're only setting one field in your nested steps, then you can combine them like

Set Field [X; Case( AAA = "XXX"; Case( not IsEmpty(B); B; not IsEmpty©; C ) )]

If AAA does not equal "XXX", then no result will be returned, nor will there be a result if B, C, etc. are all empty.

This topic is 7377 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.