Grouping Nested If Statements

M

mbrinson

I'm trying to create a conditional form letter that is conditional on
whether or not a field has data.
The desired output is three blocks of text fit onto one page based on
whether or not there is date information for the fields "Date1",
"Date2", or "Date3"

I can get it to work fine if I don't care about leaving blank space on
a page. So, if there is only data for Date1, then it will fill in the
text for the first paragraph and then leave the rest of the page blank
and then move on to the next record on the next page. I'm trying to
save that space and make it move to the next record and place the next
text block immediately after the last one instead of leaving the rest
of the page blank for that record.

So, here's the core of the logic:

I have an if statement that evaluates for three conditions.
If Date1 <> "" and Date2 = "" and Date3 = "" then EVAL = 1
If Date1 <> "" and Date2 <> "" and Date3 = "" then EVAL = 2
If Date1 <> "" and Date2 <> "" and Date3 <> "" then EVAL = 3

Then at the end of each conditional insertion of the text block I set
P1 or P2 or P3 equal to a value that corresponds with the DateX that
has been inserted (1, 2, or 3)

P1 is Paragraph 1 on the page.
P2 is Paragraph 2 on the page.
P3 is Paragraph 3 on the page.

P1 = 1 when Paragraph 1 has been filled with the text block
corresponding to Date1 not being blank.
P1 = 2 when Paragraph 1 has been filled with the text block
corresponding to Date2 not being blank.
P1 = 3 when Paragraph 1 has been filled with the text block
corresponding to Date3 not being blank.

P2 = 1 when Paragraph 1 has been filled with the text block
corresponding to Date1 not being blank.
etc..... through P3 = 3.

This, coupled with the value for EVAL provides me with a basis to
determine where exactly each text block has been placed and so know
when the last date has been processed (if there's only 1 then EVAL =
1, if there are 2, EVAL = 2, etc...) for that record. This is
necessary so that the merge document knows when to go to the next
record based on a NextIF { REF go } = 1.

I have all of the logic worked out for the case of EVAL = 1, EVAL = 2,
EVAL = 3 coupled with the different possibilities of combinations of
P1 - P3 values.

In between each of the Paragraph selection blocks there is where I
need to be able to say "NEXTIF {REF go} = 1"


ONE PAGE (MAIN MERGE DOCUMENT)
++++++++++++++++++++++++++++++++
+P1------------------------------------------------------ +
+ - Block of text1 IF Date1 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text2 IF Date2 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text3 IF Date3 <> "" - +
+ ------------------------------------------------------ +
+==============================+
+P2------------------------------------------------------ +
+ - Block of text1 IF Date1 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text2 IF Date2 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text3 IF Date3 <> "" - +
+ ------------------------------------------------------ +
+==============================+
+P3------------------------------------------------------ +
+ - Block of text1 IF Date1 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text2 IF Date2 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text3 IF Date3 <> "" - +
+ ------------------------------------------------------ +
++++++++++++++++++++++++++++++++

So, if anyone is still with me at this point, here is my problem:

The logic to figure this out requires grouping nested IF statements.
Here's how it would be in pseudo code:

For the Case of EVAL = 1
IF eval = 1
THEN IF p1 = 1 OR p2 = 1 OR P3 = 1
THEN go = 1
ELSE go = 0
END IF

For the Case of EVAL = 2 (pX would never be equal to 3 because date3
would be empty in this (eval = 2) case)
IF eval = 2
THEN IF ((p1 = 1 OR p1 = 2) AND (p2 = 1 OR p2 = 2)) OR ((p3 = 1 OR
p3 = 2) AND (p1 = 1 OR p1 = 2)) OR ((p2 = 1 OR p2 = 2) AND (p3 = 1 OR
p3 = 2))
THEN go = 1
ELSE go = 0
END IF

For the Case of EVAL = 3
IF eval = 3
THEN IF (p1 = 1 OR p1 = 2 OR P1 = 3) AND (p2 = 1 OR p2 = 2 OR p2 =
3) AND (p3 = 1 OR p3 = 2 OR P3 = 3)
THEN go = 1
ELSE go = 0

I've put this into the nested IF structure for the {IF expression ""
""} structure based on if it's AND then I put the new nested IF in the
first set of parenthesis, and if it's OR then in the second set of
parenthesis. BUT IT DOESN'T WORK.

Any help or ideas for this? Sorry about the long drawn out
explanation. I hope I've got the logic figured out. I've been
banging my head on this one a while.

THANKS! :)
 
P

Peter Jamieson

I think the basic problem you face is that a Letter merge always inserts a
Next Page section break when it starts processing a new record (after the
first record), unless it got to that record using a NEXT or NEXTIF field.

To avoid that, you have to use a Directory (Catalog) merge which does not
automatically insert any type of break. If you do that, then
a. you have to merge to a new document first
b. you have to ensure that you insert any page/section breaks that you
need, if necessary putting them inside the results of an IF field.

If there is /also/ a problem with your if fields, let's get back to that
after you try the Directory thing.
 
M

macropod

Hi mbrinson,

While you're pondering the Directory (Catalog) merge, here's a bit more to chew on.

For the conditions you posted, the following field construction should do the job:
{If{MERGEFIELD Date1}<> "" {IF{MERGEFIELD Date2}<> "" {IF{MERGEFIELD Date3}<> "" "Paragraph 3" "Paragraph 2"} "Paragraph 1"} ""}

But are you sure you haven't overlooked 5 other possibilities:
If Date1 = "" and Date2 = "" and Date3 = "" then EVAL = ?
If Date1 <> "" and Date2 = "" and Date3 <> "" then EVAL = ?
If Date1 = "" and Date2 = "" and Date3 <> "" then EVAL = ?
If Date1 = "" and Date2 <> "" and Date3 = "" then EVAL = ?
If Date1 = "" and Date2 <> "" and Date3 <> "" then EVAL = ?

Cheers
 
M

Mike

I think the basic problem you face is that a Letter merge always inserts a
Next Page section break when it starts processing a new record (after the
first record), unless it got to that record using a NEXT or NEXTIF field.

To avoid that, you have to use a Directory (Catalog) merge which does not
automatically insert any type of break. If you do that, then
a. you have to merge to a new document first
b. you have to ensure that you insert any page/section breaks that you
need, if necessary putting them inside the results of an IF field.

If there is /also/ a problem with your if fields, let's get back to that
after you try the Directory thing.

That was exactly what I needed! Wow, how simple. Could have saved
myself hours in tortuous logical thought
THANK YOU!!!!! :)
 
M

Mike

Hi mbrinson,

While you're pondering the Directory (Catalog) merge, here's a bit more to chew on.

For the conditions you posted, the following field construction should do the job:
{If{MERGEFIELD Date1}<> "" {IF{MERGEFIELD Date2}<> "" {IF{MERGEFIELD Date3}<> "" "Paragraph 3" "Paragraph 2"} "Paragraph 1"} ""}

But are you sure you haven't overlooked 5 other possibilities:
If Date1 = "" and Date2 = "" and Date3 = "" then EVAL = ?
If Date1 <> "" and Date2 = "" and Date3 <> "" then EVAL = ?
If Date1 = "" and Date2 = "" and Date3 <> "" then EVAL = ?
If Date1 = "" and Date2 <> "" and Date3 = "" then EVAL = ?
If Date1 = "" and Date2 <> "" and Date3 <> "" then EVAL = ?

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

I'm trying to create a conditional form letter that is conditional on
whether or not a field has data.
The desired output is three blocks of text fit onto one page based on
whether or not there is date information for the fields "Date1",
"Date2", or "Date3"
I can get it to work fine if I don't care about leaving blank space on
a page. So, if there is only data for Date1, then it will fill in the
text for the first paragraph and then leave the rest of the page blank
and then move on to the next record on the next page. I'm trying to
save that space and make it move to the next record and place the next
text block immediately after the last one instead of leaving the rest
of the page blank for that record.
So, here's the core of the logic:
I have an if statement that evaluates for three conditions.
If Date1 <> "" and Date2 = "" and Date3 = "" then EVAL = 1
If Date1 <> "" and Date2 <> "" and Date3 = "" then EVAL = 2
If Date1 <> "" and Date2 <> "" and Date3 <> "" then EVAL = 3
Then at the end of each conditional insertion of the text block I set
P1 or P2 or P3 equal to a value that corresponds with the DateX that
has been inserted (1, 2, or 3)
P1 is Paragraph 1 on the page.
P2 is Paragraph 2 on the page.
P3 is Paragraph 3 on the page.
P1 = 1 when Paragraph 1 has been filled with the text block
corresponding to Date1 not being blank.
P1 = 2 when Paragraph 1 has been filled with the text block
corresponding to Date2 not being blank.
P1 = 3 when Paragraph 1 has been filled with the text block
corresponding to Date3 not being blank.
P2 = 1 when Paragraph 1 has been filled with the text block
corresponding to Date1 not being blank.
etc..... through P3 = 3.
This, coupled with the value for EVAL provides me with a basis to
determine where exactly each text block has been placed and so know
when the last date has been processed (if there's only 1 then EVAL =
1, if there are 2, EVAL = 2, etc...) for that record. This is
necessary so that the merge document knows when to go to the next
record based on a NextIF { REF go } = 1.
I have all of the logic worked out for the case of EVAL = 1, EVAL = 2,
EVAL = 3 coupled with the different possibilities of combinations of
P1 - P3 values.
In between each of the Paragraph selection blocks there is where I
need to be able to say "NEXTIF {REF go} = 1"
ONE PAGE (MAIN MERGE DOCUMENT)
++++++++++++++++++++++++++++++++
+P1------------------------------------------------------ +
+ - Block of text1 IF Date1 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text2 IF Date2 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text3 IF Date3 <> "" - +
+ ------------------------------------------------------ +
+==============================+
+P2------------------------------------------------------ +
+ - Block of text1 IF Date1 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text2 IF Date2 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text3 IF Date3 <> "" - +
+ ------------------------------------------------------ +
+==============================+
+P3------------------------------------------------------ +
+ - Block of text1 IF Date1 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text2 IF Date2 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text3 IF Date3 <> "" - +
+ ------------------------------------------------------ +
++++++++++++++++++++++++++++++++
So, if anyone is still with me at this point, here is my problem:
The logic to figure this out requires grouping nested IF statements.
Here's how it would be in pseudo code:
For the Case of EVAL = 1
IF eval = 1
THEN IF p1 = 1 OR p2 = 1 OR P3 = 1
THEN go = 1
ELSE go = 0
END IF
For the Case of EVAL = 2 (pX would never be equal to 3 because date3
would be empty in this (eval = 2) case)
IF eval = 2
THEN IF ((p1 = 1 OR p1 = 2) AND (p2 = 1 OR p2 = 2)) OR ((p3 = 1 OR
p3 = 2) AND (p1 = 1 OR p1 = 2)) OR ((p2 = 1 OR p2 = 2) AND (p3 = 1 OR
p3 = 2))
THEN go = 1
ELSE go = 0
END IF
For the Case of EVAL = 3
IF eval = 3
THEN IF (p1 = 1 OR p1 = 2 OR P1 = 3) AND (p2 = 1 OR p2 = 2 OR p2 =
3) AND (p3 = 1 OR p3 = 2 OR P3 = 3)
THEN go = 1
ELSE go = 0
I've put this into the nested IF structure for the {IF expression ""
""} structure based on if it's AND then I put the new nested IF in the
first set of parenthesis, and if it's OR then in the second set of
parenthesis. BUT IT DOESN'T WORK.
Any help or ideas for this? Sorry about the long drawn out
explanation. I hope I've got the logic figured out. I've been
banging my head on this one a while.

Sorry, forgot to mention that just because of the business logic there
will always be a date1. If there is a date2 then there is a date1.
Also if there is a date3, then there is a date2.
Thanks for the IF statement construction. I'm going to try that out
just to see now anyway.
Thanks so much for taking the time to respond. You guys are great! :)
 
M

Mike

Hi mbrinson,

While you're pondering the Directory (Catalog) merge, here's a bit more to chew on.

For the conditions you posted, the following field construction should do the job:
{If{MERGEFIELD Date1}<> "" {IF{MERGEFIELD Date2}<> "" {IF{MERGEFIELD Date3}<> "" "Paragraph 3" "Paragraph 2"} "Paragraph 1"} ""}

But are you sure you haven't overlooked 5 other possibilities:
If Date1 = "" and Date2 = "" and Date3 = "" then EVAL = ?
If Date1 <> "" and Date2 = "" and Date3 <> "" then EVAL = ?
If Date1 = "" and Date2 = "" and Date3 <> "" then EVAL = ?
If Date1 = "" and Date2 <> "" and Date3 = "" then EVAL = ?
If Date1 = "" and Date2 <> "" and Date3 <> "" then EVAL = ?

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

I'm trying to create a conditional form letter that is conditional on
whether or not a field has data.
The desired output is three blocks of text fit onto one page based on
whether or not there is date information for the fields "Date1",
"Date2", or "Date3"
I can get it to work fine if I don't care about leaving blank space on
a page. So, if there is only data for Date1, then it will fill in the
text for the first paragraph and then leave the rest of the page blank
and then move on to the next record on the next page. I'm trying to
save that space and make it move to the next record and place the next
text block immediately after the last one instead of leaving the rest
of the page blank for that record.
So, here's the core of the logic:
I have an if statement that evaluates for three conditions.
If Date1 <> "" and Date2 = "" and Date3 = "" then EVAL = 1
If Date1 <> "" and Date2 <> "" and Date3 = "" then EVAL = 2
If Date1 <> "" and Date2 <> "" and Date3 <> "" then EVAL = 3
Then at the end of each conditional insertion of the text block I set
P1 or P2 or P3 equal to a value that corresponds with the DateX that
has been inserted (1, 2, or 3)
P1 is Paragraph 1 on the page.
P2 is Paragraph 2 on the page.
P3 is Paragraph 3 on the page.
P1 = 1 when Paragraph 1 has been filled with the text block
corresponding to Date1 not being blank.
P1 = 2 when Paragraph 1 has been filled with the text block
corresponding to Date2 not being blank.
P1 = 3 when Paragraph 1 has been filled with the text block
corresponding to Date3 not being blank.
P2 = 1 when Paragraph 1 has been filled with the text block
corresponding to Date1 not being blank.
etc..... through P3 = 3.
This, coupled with the value for EVAL provides me with a basis to
determine where exactly each text block has been placed and so know
when the last date has been processed (if there's only 1 then EVAL =
1, if there are 2, EVAL = 2, etc...) for that record. This is
necessary so that the merge document knows when to go to the next
record based on a NextIF { REF go } = 1.
I have all of the logic worked out for the case of EVAL = 1, EVAL = 2,
EVAL = 3 coupled with the different possibilities of combinations of
P1 - P3 values.
In between each of the Paragraph selection blocks there is where I
need to be able to say "NEXTIF {REF go} = 1"
ONE PAGE (MAIN MERGE DOCUMENT)
++++++++++++++++++++++++++++++++
+P1------------------------------------------------------ +
+ - Block of text1 IF Date1 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text2 IF Date2 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text3 IF Date3 <> "" - +
+ ------------------------------------------------------ +
+==============================+
+P2------------------------------------------------------ +
+ - Block of text1 IF Date1 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text2 IF Date2 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text3 IF Date3 <> "" - +
+ ------------------------------------------------------ +
+==============================+
+P3------------------------------------------------------ +
+ - Block of text1 IF Date1 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text2 IF Date2 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text3 IF Date3 <> "" - +
+ ------------------------------------------------------ +
++++++++++++++++++++++++++++++++
So, if anyone is still with me at this point, here is my problem:
The logic to figure this out requires grouping nested IF statements.
Here's how it would be in pseudo code:
For the Case of EVAL = 1
IF eval = 1
THEN IF p1 = 1 OR p2 = 1 OR P3 = 1
THEN go = 1
ELSE go = 0
END IF
For the Case of EVAL = 2 (pX would never be equal to 3 because date3
would be empty in this (eval = 2) case)
IF eval = 2
THEN IF ((p1 = 1 OR p1 = 2) AND (p2 = 1 OR p2 = 2)) OR ((p3 = 1 OR
p3 = 2) AND (p1 = 1 OR p1 = 2)) OR ((p2 = 1 OR p2 = 2) AND (p3 = 1 OR
p3 = 2))
THEN go = 1
ELSE go = 0
END IF
For the Case of EVAL = 3
IF eval = 3
THEN IF (p1 = 1 OR p1 = 2 OR P1 = 3) AND (p2 = 1 OR p2 = 2 OR p2 =
3) AND (p3 = 1 OR p3 = 2 OR P3 = 3)
THEN go = 1
ELSE go = 0
I've put this into the nested IF structure for the {IF expression ""
""} structure based on if it's AND then I put the new nested IF in the
first set of parenthesis, and if it's OR then in the second set of
parenthesis. BUT IT DOESN'T WORK.
Any help or ideas for this? Sorry about the long drawn out
explanation. I hope I've got the logic figured out. I've been
banging my head on this one a while.

So, any ideas (out of curiosity) on the kind of IF field construction
that would be needed for the last group of logic I posted? I don't
know if it's even possible.
I'm talking about this part:
"For the Case of EVAL = 2 (pX would never be equal to 3 because date3
would be empty in this (eval = 2) case)
IF eval = 2
THEN IF ((p1 = 1 OR p1 = 2) AND (p2 = 1 OR p2 = 2)) OR ((p3 = 1 OR
p3 = 2) AND (p1 = 1 OR p1 = 2)) OR ((p2 = 1 OR p2 = 2) AND (p3 = 1 OR
p3 = 2))
THEN go = 1
ELSE go = 0
END IF"
 
M

macropod

Mike said:
Hi mbrinson,

While you're pondering the Directory (Catalog) merge, here's a bit more to chew on.

For the conditions you posted, the following field construction should do the job:
{If{MERGEFIELD Date1}<> "" {IF{MERGEFIELD Date2}<> "" {IF{MERGEFIELD Date3}<> "" "Paragraph 3" "Paragraph 2"} "Paragraph 1"} ""}

But are you sure you haven't overlooked 5 other possibilities:
If Date1 = "" and Date2 = "" and Date3 = "" then EVAL = ?
If Date1 <> "" and Date2 = "" and Date3 <> "" then EVAL = ?
If Date1 = "" and Date2 = "" and Date3 <> "" then EVAL = ?
If Date1 = "" and Date2 <> "" and Date3 = "" then EVAL = ?
If Date1 = "" and Date2 <> "" and Date3 <> "" then EVAL = ?

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

I'm trying to create a conditional form letter that is conditional on
whether or not a field has data.
The desired output is three blocks of text fit onto one page based on
whether or not there is date information for the fields "Date1",
"Date2", or "Date3"
I can get it to work fine if I don't care about leaving blank space on
a page. So, if there is only data for Date1, then it will fill in the
text for the first paragraph and then leave the rest of the page blank
and then move on to the next record on the next page. I'm trying to
save that space and make it move to the next record and place the next
text block immediately after the last one instead of leaving the rest
of the page blank for that record.
So, here's the core of the logic:
I have an if statement that evaluates for three conditions.
If Date1 <> "" and Date2 = "" and Date3 = "" then EVAL = 1
If Date1 <> "" and Date2 <> "" and Date3 = "" then EVAL = 2
If Date1 <> "" and Date2 <> "" and Date3 <> "" then EVAL = 3
Then at the end of each conditional insertion of the text block I set
P1 or P2 or P3 equal to a value that corresponds with the DateX that
has been inserted (1, 2, or 3)
P1 is Paragraph 1 on the page.
P2 is Paragraph 2 on the page.
P3 is Paragraph 3 on the page.
P1 = 1 when Paragraph 1 has been filled with the text block
corresponding to Date1 not being blank.
P1 = 2 when Paragraph 1 has been filled with the text block
corresponding to Date2 not being blank.
P1 = 3 when Paragraph 1 has been filled with the text block
corresponding to Date3 not being blank.
P2 = 1 when Paragraph 1 has been filled with the text block
corresponding to Date1 not being blank.
etc..... through P3 = 3.
This, coupled with the value for EVAL provides me with a basis to
determine where exactly each text block has been placed and so know
when the last date has been processed (if there's only 1 then EVAL =
1, if there are 2, EVAL = 2, etc...) for that record. This is
necessary so that the merge document knows when to go to the next
record based on a NextIF { REF go } = 1.
I have all of the logic worked out for the case of EVAL = 1, EVAL = 2,
EVAL = 3 coupled with the different possibilities of combinations of
P1 - P3 values.
In between each of the Paragraph selection blocks there is where I
need to be able to say "NEXTIF {REF go} = 1"
ONE PAGE (MAIN MERGE DOCUMENT)
++++++++++++++++++++++++++++++++
+P1------------------------------------------------------ +
+ - Block of text1 IF Date1 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text2 IF Date2 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text3 IF Date3 <> "" - +
+ ------------------------------------------------------ +
+==============================+
+P2------------------------------------------------------ +
+ - Block of text1 IF Date1 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text2 IF Date2 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text3 IF Date3 <> "" - +
+ ------------------------------------------------------ +
+==============================+
+P3------------------------------------------------------ +
+ - Block of text1 IF Date1 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text2 IF Date2 <> "" - +
+ ------------------------------------------------------ +
+ - Block of text3 IF Date3 <> "" - +
+ ------------------------------------------------------ +
++++++++++++++++++++++++++++++++
So, if anyone is still with me at this point, here is my problem:
The logic to figure this out requires grouping nested IF statements.
Here's how it would be in pseudo code:
For the Case of EVAL = 1
IF eval = 1
THEN IF p1 = 1 OR p2 = 1 OR P3 = 1
THEN go = 1
ELSE go = 0
END IF
For the Case of EVAL = 2 (pX would never be equal to 3 because date3
would be empty in this (eval = 2) case)
IF eval = 2
THEN IF ((p1 = 1 OR p1 = 2) AND (p2 = 1 OR p2 = 2)) OR ((p3 = 1 OR
p3 = 2) AND (p1 = 1 OR p1 = 2)) OR ((p2 = 1 OR p2 = 2) AND (p3 = 1 OR
p3 = 2))
THEN go = 1
ELSE go = 0
END IF
For the Case of EVAL = 3
IF eval = 3
THEN IF (p1 = 1 OR p1 = 2 OR P1 = 3) AND (p2 = 1 OR p2 = 2 OR p2 =
3) AND (p3 = 1 OR p3 = 2 OR P3 = 3)
THEN go = 1
ELSE go = 0
I've put this into the nested IF structure for the {IF expression ""
""} structure based on if it's AND then I put the new nested IF in the
first set of parenthesis, and if it's OR then in the second set of
parenthesis. BUT IT DOESN'T WORK.
Any help or ideas for this? Sorry about the long drawn out
explanation. I hope I've got the logic figured out. I've been
banging my head on this one a while.

So, any ideas (out of curiosity) on the kind of IF field construction
that would be needed for the last group of logic I posted? I don't
know if it's even possible.
I'm talking about this part:
"For the Case of EVAL = 2 (pX would never be equal to 3 because date3
would be empty in this (eval = 2) case)
IF eval = 2
THEN IF ((p1 = 1 OR p1 = 2) AND (p2 = 1 OR p2 = 2)) OR ((p3 = 1 OR
p3 = 2) AND (p1 = 1 OR p1 = 2)) OR ((p2 = 1 OR p2 = 2) AND (p3 = 1 OR
p3 = 2))
THEN go = 1
ELSE go = 0
END IF"

Hi Mike,

I'm not following what you're trying to do that can't be done with the field construction I posted, or with:
{IF{MERGEFIELD Date3}<> "" "Paragraph 3" {IF{MERGEFIELD Date2}<> "" "Paragraph 2" {IF{MERGEFIELD Date1}<> "" "Paragraph 1"}}}
You can, if you wish, have multiple paragraphs as the mergefield output - even including tables and graphics if needed. You can also
re-use the field construction in multiple places to output different paragraphs. For example, in addition to the above, the same
letter could have:
{IF{MERGEFIELD Date3}<> "" "Paragraph 4" {IF{MERGEFIELD Date2}<> "" "Paragraph 5" {IF{MERGEFIELD Date1}<> "" "Paragraph 6"}}}

Cheers
 

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