OR in a mergefield?

C

Compass Rose

I would like to use OR in an If...then...else... Word Field.

If {MERGEFIELD Company} = "Company A" OR {MERGEFIELD Company} = "Company B"
OR {MERGEFIELD Company} = "Company C" then......

Is it possible, and if so, what is the correct syntax?

TIA
David
 
P

Peter Jamieson

There is no OR in the IF field, but there are other ways to achieve the
same effect, depending on exactly what you need.

{ IF "{ MERGEFIELD Company }" = "Company A" "X" "Y" }
{ IF "{ MERGEFIELD Company }" = "Company B" "X" "Y" }

is one way that may be enough in simple situations.

{ COMPARE "{ MERGEFIELD Company }" = "Company A" } returns 1 if Company is
"Company A", 0 otherwise, so you can use

{ IF { =or({ COMPARE "{ MERGEFIELD Company }" = "Company A" },{ COMPARE
"{ MERGEFIELD Company }" = "Company B" }) } = 1 "X" "Y" }

or just use addition, e.g.

{ IF { ={ COMPARE "{ MERGEFIELD Company }" = "Company A" }+{ COMPARE "{
MERGEFIELD Company }" = "Company B" } } > 0 "X" "Y" }

Peter Jamieson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top