Defining Conditions
Learn to define new conditions.
To add a new condition to a query:
- Load a query, see Loading Queries.
- Click on to the left of
Conditions and select Add Condition
from the menu. The following window opens:
The fields that you can access based on your Aurea CRM access rights are displayed. Your administrator is responsible for defining your access rights.
- Click on a column heading to sort the list.
- Select a field and click on Next. You can also enter part of the
name of the field in the Field name field:
- Enter one or two letters to list all the fields that begin with those letters.
- Enter more than two letters to list all fields that contain the sub-string in their name.
- Define your condition. Depending on the Field Type, you can
define the following conditions:
- Text field; see Conditions for Numeric, Alphanumeric and Time Fields.
- Date field; see Conditions for Date Fields and Variable Conditions.
- Catalog field; see Conditions for Catalogs and Conditions for Child Catalogs.
- Numeric field; see Conditions for Numeric, Alphanumeric and Time Fields.
- Logical (Boolean) field; see Conditions for Boolean Fields.
- Time field; see Conditions for Numeric, Alphanumeric and Time Fields.
- Rep field; see Conditions for Rep Fields and Variable Conditions.
- Click on OK. This condition displayed in the overview.
Conditions for Catalogs
To define a condition for a catalog:
- Select a catalog field. A dialog box is opened, allowing you to define the condition
for the field.
The available catalog values are listed to the left. Use as Parameter is at the top of the list. You can use this value if the comparison value should be entered whenever the query is run. For further details, see Parameters and Predefined Queries.
- Choose the appropriate operator, e.g. = (equal) to determine that the condition should return records where the value of the catalog field matches the comparison value.
- Select Fixed to compare the contents of the field with a fixed value from the list of entries. Select Field to compare the contents of a field, see Comparing Field Contents. The Text option is also available for variable catalogs, see Conditions for Variable Catalogs.
- Double-click on an entry under Available fields to use it as a comparison value. The entry is moved to the right under Selected Fields.
- Double-click on an item in the right area to remove it.
- Click on OK to return to the query.
Conditions for Variable Catalogs
When applying conditions to variable conditions, you can also use wildcards in comparison values. This allows you to apply conditions to sub-strings. To do so:
- Select a variable catalog field. The dialog used to define the condition is
displayed.
- Click on Text.
- An input field is displayed. Enter the comparison value here. You can use the * (any number of characters) and ? (single character) wildcards. All catalog values that match your comparison value are returned by the query.
Conditions for Child Catalogs
When defining a condition applied to a child catalog (e.g. the Interest field in the Interest info area), you need to specify the parent catalog value (e.g. Interest Group) before you can define the condition for the child catalog.
The following example uses the Interest field in the Interest info area:
Conditions applied to child catalogs are otherwise defined the same as for all other catalogs. For further details, see Conditions for Catalogs.
Conditions for Boolean Fields
To define a condition for a Boolean field:
- Select a Boolean field.
- Specify the type of comparison (equal, not equal).
- Select Fixed to compare the contents of the field with a fixed value from the list of entries. Select Field to compare the contents of a field. For further details, see Comparing Field Contents.
- Select either Yes, (true) No (false) or Use as parameter as the comparison value. For further details, see Parameters and Predefined Queries
- Click on OK to return to the query overview.
Conditions for Date Fields
To define a condition applied to a date field:
- Select a date field.
- Select the type of comparison (equal, not equal etc.).
- Date fields allow you to use fixed and variable comparison values. Use the Fixed option to compare the value with a specific date or to a value entered by the user (if the Use as Parameter option is enabled). Use the Variable option to enter a date relative to the date the query is executed on. Select Field to compare the value with the contents of another field. For further details, see Variable Conditions, Comparing Field Contents and Parameters and Predefined Queries.
- Click on OK to return to the query overview.
Conditions for Numeric, Alphanumeric and Time Fields
To define a condition applied to a numeric, text or time field:
- Select either a numeric, text or time field.
- Define the type of comparison (equal, greater etc.).
- Determine what to compare the contents of the field with. Choose between Fixed, Variable, Field (compare with the contents of another field). For further details, see Variable Conditions and Comparing Field Contents. If you select Fixed, you can enable Use as parameter (requires user input) to allow users to enter the comparison value when executing the query. For further details, see Parameters and Predefined Queries.
- Enter the comparison value in the Value field.
- Enable the Use as Parameter option if you want the comparison value to be entered by the user upon starting the query. For further details, see Parameters and Predefined Queries. Wildcards (*, ?) may also be used for text fields.
- Click on OK to return to the query overview.
Conditions for Rep Fields
To apply a condition to a rep field:
- Select a rep field.
- Specify the type of comparison (equal, not equal).
- You can define both Fixed and
Variable conditions for reps. Use the Field
option to compare the rep to an entry in another rep field. For further
details, see Comparing Field Contents.
Enable the Use as Parameter option if you want a comparison
value to be entered by the user upon starting the query. For further details,
see Parameters and Predefined Queries.
If you have selected Fixed, you need to select the rep used in the condition.
Note: You can select several reps as comparison values. The reps are linked with a logical OR.Select the rep(s), see Selecting Reps.
The selected reps are listed in the rep field. Reps are separated using a semicolon.
Variable Conditions
If the same query is used by various reps or is carried out regularly, you can define variable conditions that are applied to rep and date fields (e.g. the current rep or current date).
Variable Reps
To define a variable condition applied to rep field:
- Select a rep field and enable the Variable option.
- Select an option from the drop-down list. The appropriate user is used by the query as a comparison value when it is executed.
Variable Date Fields
Variable dates are dates relative to the date on which the query is executed, e.g. 40 days from today.
To define a variable condition for a date field:
- Select a date field and enable the Variable option.
- Select the reference date from the drop-down list.
- Determine time period added (Plus) or subtracted
(Minus) from the reference date.
Variable Time Fields
The time at which the query is executed can be used to define the comparison value for time fields.
To define a variable condition for a time field:
- Select a time field and choose the desired comparison type.
- Select the desired time format from the drop-down list.
Comparing Field Contents
When defining conditions, you can choose to compare the value stored in fields in a record.
You can compare the following fields:
- Fields of the same type, e.g. two numeric fields
- Catalog fields that access the same catalog
To define a condition that compares the contents of two fields:
- Define a condition.
- Select the Field option.
- Click on (Select). All fields of the same type in the info area are listed.
- Select the desired field for the comparison.