qCalendarView : qCalendar Pages : Content Page : Filtering

Filtering
The Filtering page allows you to use CAML filters to dynamically filter records or use Complex Filters to define static filter for the data.
The Filtering page contains the following:
 
Table 10. Filtering
CAML Filters
CAML Filter expressions help filter data by providing a way to link multiple conditions.
Turn Advanced Mode on if you want to edit CAML Filters in XML format.
The operators and field names in the CAML Filter are case sensitive. For the field name, use the internal name of the field.
 
The Boolean operators <And> and <Or> are supported in CAML Filter. These operators are used to combine two conditions. They must contain exactly two conditions. For example:
<And><Eq>...</Eq><Gt>...</Gt></And>
If you need to link more than two conditions, such as Condition1 And Condition 2 And Condition3, you must nest these operators. For example:
<And><Eq>...</Eq><And><Gt>...</Gt><Lt>...</Lt></And></And>
You can specify conditions for CAML Filter in either of the following ways:
This returns all entries whose field specified by InternalFieldName does not contain any value.
This returns all entries whose field specified by InternalFieldName contains values (including empty string value).
Where:
 
Using CAML Filters
CAML filters allow you set the following variables to validate text fields:
 
Variables work if you store either the user name, login name, user ID, or email address in a Single Line of Text field. qListForm and qSIListForm use variables in the Fixed Value or Form Component Behavior sections.
For a field of type Single-line-of-Text or Multi-line Plain Text, the Operator drop-down menu contains the value, Matches, as an operator for comparing the field value to a regular expression.
Examples of common regular expressions:
Using Dynamic Variables
The CAML Filter can also be used with dynamic variables. The Value element in the CAML Filter can come from various sources such as an HTTP Parameter and Session.
 
to enter the value in the Value element - <Value Type="Text">Some Text</Value>
to retrieve the value from an HTTP parameter - <Value Type="Text" Source="HttpParameter" SourceName="NameOfHTTPParameter"/>
to retrieve the value from the Session variable - <Value Type="Text" Source="Session" SessionName="SessionName" SourceName="NameOfHTTPParameter" SiteUrl="url" ListName="ListName"/>
to compare values of two fields - <Value Type="FieldName" Source="Field">Editor</Value>
Complex Filters
Complex Filter provides a powerful way to concatenate multiple conditions.
The date and time value must be enclosed in # and specified in ISO 8601 format: YYYY-MM-DDThh:mm:ssZ. For example, midnight of February 14, 2002 is #2002-02-14T00:00:00Z#.
The operators and field names in the Complex Filter are case sensitive. For the field name, use the display name of the field (include all spaces if there are any).
The following Boolean operators are supported in Complex Filter:
NOT This is used to negate a condition. For example, to get all employees whose name does not start with M, they syntax is: NOT Employee Name LIKE 'M%'
AND and OR This is used to concatenate two conditions. The AND operator takes precedence over the OR. Use parentheses to change the precedence of the operator.
For example, to get all employees in the Accounting or IT department and hired after 1/1/2004: (Department='Accounting' OR Department='IT') AND Hired Date>#2004-01-01T00:00:00Z#
Specify conditions for Complex Filter is specified in one of following ways:
1
This will return all entries whose field specified by FieldName does not contain any value.
Some entries contain an empty string value ("") and their display is indistinguishable from the entries with a NULL value. If you want to return such entries, use FieldName='' as the filter expression.
2
This will return all entries whose field specified by FieldName contains DBNull value. It is tricky to determine whether a field is empty, contains null value or contains DBNull value. It all depends on the field type and the type of back end system that you are dealing with. Therefore, try each one ("fieldName IS NULL", "fieldName IS DBNULL" or "fieldName=''") in order to identify which one is the appropriate option for your needs.
3
This will return all entries whose field specified by FieldName contains values (including empty string value).
4
Comparison operator is one of these: =, <> (not equal), <, >, <=, >=, LIKE
FieldExpression can be one of the following:
String A string is enclosed with single quote; for example 'Accounting'. A string can contain wild-card character % or * when used in conjunction with the LIKE operator. For example: 'M%', 'M*'. A wild-card character is not allowed in the middle of a string. Therefore, this expression is illegal: 'Te*xt'
Numbers Numbers are not enclosed. For example: 20, 20.5, 0.5. If you enclose a number with a single quote, it is treated as string.
Dates For example: February 5, 2005 11:50 PM is #2005-02-05T23:50:00Z#.
[ME] This expression is replaced with the name of the currently logged-in user.
[TODAY] This expression is replaced with midnight of today's date.
[NOW] This expression is replaced with the current date and time.
Date function The following date functions are supported: AddSeconds, AddMinutes, AddHours, AddDays, AddMonths and AddYears. Their syntax is DateFunction(dateValue, number). For example: AddDays([TODAY], 7) adds 7 days to today's date
The following are some examples of the complex filter:
1
PerformedBy=[ME] AND DueDate>=[TODAY] AND DueDate<=AddDays([TODAY], 7)
2
PerformedBy IS NULL AND DueDate>=[TODAY] AND DueDate<=AddDays([TODAY], 3)
3
DueDate<[TODAY]