Contents
- Index
Conditional commands on custom reports:
Your report can be setup to include certain items only under certain conditions.
Here are several conditions you can test for:
{if CONDITION}xxx{/if} Show xxx if the CONDITION is true. For example: the following command includes the organization's country if it is different from the donor's country:
{if {org_info:land}!={donors:land}} {org_info:land}{/if}
{if CONDITION}xxx{else}yyy{/if} Show xxx if the CONDITION is true and yyy if it is false.
{if CONDITION1}text1{else if CONDITION2}text2{else if CONDITION3}text3...{/if} Check a set of conditions until one is found to be true and show the text.
The CONDITION in an if statement checks:
a) whether an item has any text
b) whether a date field in a file is a given time in the past or earlier. The format is ago FILE:FIELD NUMBER m to see if the date is that many months ago or ago FILE:FIELD NUMBER d to see if the date is that many days ago. For example: to see if a donor was added 6 months ago or earlier use: {if ago donors:since 6m}
c) whether something about a donor is true. For example, this:
{if is early}Some donations were before the pledge start date{/if}
will print a message if the donor donated before the pledge start date.
d) compares two items. Each item is either a file field name, a calculated field, a number or some text or a date enclosed in double quotes. Between each item is a comparison operator. The possible operators are:
Operator: Description:
= Are the two items equal?
!= Are the two items different?
> Is the first item greater than the second one?
< Is the first item less than the second one?
>= Is the first item greater than or equal to the second one?
<= Is the first item less than or equal to the second one?
>> Does the first item contain the second one?
!>> Does the first item not contain the second one?
Here are some examples:
{if {donors:land}!={org_info:land}} Is donor's country different from the organization's country?
{if {donors:memo}!=""} Is there a "Receipt Memo" for this donor?
{if {donors:memo}} You can also check if there is any text by leaving out the operator and second item.
{if {donors:rcptyp}="D"} Does this donor get one receipt per donation?
{if {donors:rcptyp}=" "} Does this donor get yearly receipts?
{if {total}>25.00} Is the total on the receipt more than $25.00?
{if {donors:lastdn}>>"?"} This checks whether a donor ever made a donation. (If any date has a ? then there is no date.)
{if {donors:lastdn}>="Jan 1, 2010"} By comparing the date of the last donation to Jan 1, 2010 you can find out if the donor made a donation in the year 2010 or later?
{if {donors:birth}>today} Is the donor's birthday coming up in the future?
{if {donors:birth}<today} Did we miss the donor's birthday?
{if {paidby}>>"Check"} Does the method of payment contain the word "Check" which means it has a check number?
{if {donors:status}="B"} Is this donor a business? (Assumes the business donor type has the abbreviation B).
{if {donors:charac}>>"C"} Does this donor have the characteristic with the abbreviation C?
{if {donors:charac}!>>"H"} Does this donor not have the characteristic with the abbreviation H?
{if {fulfill}} To fulfill your pledge, please give {fulfill}{/if} Show a message about how much is needed to fulfill a pledge only if the donor is falling short.
{if {available h}<0.5}{newpage}{/if} Check how much vertical space there is to the bottom of the page. If <0.5" go to the next page.
You can also display a message to a user if some fields have a specific value. {msg <text>} will display a message. For example:
{if {donors:lastdn}>>"?"}{msg This donor did not donate}{/if} Display a message if this donor had no donations.
Messages would be shown for all donors with the condition you are checking for. To show a message only once use:
{msg 1 <text>}
© 1998-2023 Nuverb Systems Inc. "Software Tailored for You"