<< Click to Display Table of Contents >> Navigation: »No topics above this level« Available Functions |
Functions provide different ways of looking at the data in the various fields of DonorQuest. Functions allow you to make the data within fields appear in a transformed fashion, without altering the actual data itself. Functions also provide a means of converting values you enter to forms that are compatible with particular fields. For example, the "CtoD()" function provides a way to convert a character value such as "10/20/2024" to a Date Type, so that it may be compared against database fields which are also of date type. The concept of a function will be familiar to many Excel users, as spreadsheet applications offer extensive function libraries used for transforming how data appears in cells, and for doing computations involving multiple rows or adjacent columns.
Functions have applications in many aspects of DonorQuest, and they are one of its greatest strengths. They can be used when defining Reports Layouts, Label Layouts, Selections, and Field Groups used for exporting data to other software programs like Excel. They can also be used in making sweeping changes to your database.
A function can be thought of as a special-purpose "machine." Each special-purpose machine or function expects to be given certain types of data to process. In return, each function will give back information that is a processed version of what it was given, or actually an answer to some question like, "When is the last time a specific donor gave to our ABC Campaign?"
For example, there is a function called "Upper()". If you give this function a field name, it will return the contents of the field with all letters converted to upper case.
The way you "give" a function information is to enclose the information within parentheses following the function name. For example, to convert the last name of a donor to all upper case (perhaps for comparison to some specific value during a Selection), you would use the "Upper()" function like this:
Upper( .Last_Name. )
The "information" given to a function is called a parameter. In the last example, the parameter to the "Upper()" function was ".Last_Name.". Some functions take more than one parameter, others take no parameters at all. For example, there is a function called "Date()". This function will return today's date, but you do not pass it any parameters. You would simply use it like this:
Date()
...or in creating a true/false selection condition like this:
.Donation_Date. = Date()
In DonorQuest, no function you use will ever change the value of a parameter you pass it. That is to say, if you give a function a parameter such as a field name, you can be assured that the function will not change the data within that field in the database. A function will only generate a temporary value to be used in a condition, report, or export. For example, using the Upper() function on the .Last_Name. field will not change all the last names to upper case in the database. It will, however, allow you to create a temporary "view" of all the last names that would make them appear as if they were all upper case. However, if you were to assign the output of a function to existing data records using the Replace feature of Selection Results, then you could effectively use a function for mass data changes. But that's using the function output in a special way - the data of field parameter(s) you pass a function will still never be changed.
The functions cataloged in this topic are for reference only. Some are very simple (like the Upper() function), while others can be very complex (like the If() and Sum_In() functions). You really do not need to know anything about functions in order to use DonorQuest effectively. They have been provided as an additional enhancement which goes far beyond what most fundraising systems normally provide. Which functions (if any) you may eventually use really depends on your needs, and how comfortable you are with the concept. If you have a strong background in other business applications like Microsoft Excel and Access, which both allow the use of function-based expressions, you will find DonorQuest functions very easy to use.
There is no compelling reason for you to master every single function. This function topic is a bit like a tool chest -- when you have a particular task to perform, one tool more than any other will probably be best suited to the task, and you'll come looking for it here when the need arises.
In DonorQuest, there are basically four types of information that a function can receive as a parameter, or return as a value. They are:
Character
A character type consists of alphanumerics -- letters and/or numbers mixed together in a stream of characters. The donor address field is a good example of one such field, since it contains letters as well as numbers. The Upper() function is one which takes a character type as a parameter, and returns a value which is also a character type.
Numeric
A Numeric type consists of numbers, sign (shown as a minus symbol for negative numbers), and decimal point only. The donation amount field is of numeric type.
Date
A Date type deals strictly with calendar dates, normally of the form mm/dd/yyyy. Internally DonorQuest will always store date values in a specific way that allows it to know what it is storing is a date. However, the outward appearance of date values in DonorQuest are governed by the preferences you have set under User, Change Your Personal Settings. There you can choose your preferred date format. DonorQuest also supports date arithmetic, for example, if today is 07/01/2024, then Date() + 1 would be 07/02/2024.
Logical
A Logical type deals only with true/false information. A Logical value is usually returned by functions that answer yes or no questions.
The topics which follow define each of the functions available for your use in various aspects of DonorQuest. This guide serves merely as a reference of all available DonorQuest functions. The best examples of their use is in the many predefined Report Layouts, Field Groups, and Selection Definitions provided with DonorQuest.