Welcome to the Janison Academy help portal

Building Filters

Introduction

You can set up rules to precisely define parts of a CLS entity. These rules are called filters in the CLS They can very precisely select members of an entity because they are combined using Boolean logic, which can also be nested. This will be best understood by someone who is comfortable with:

  • Boolean operations (AND, OR, NOT),
  • its language (e.g. “!” means “NOT”), and
  • how nesting limits scope

If you understand these go straight to Filter Building, otherwise start with Concepts – Easier Introduction to Filters .

Concepts

Easier Introduction to Filters

Consider a group of items with different colours and labels:

If we select all the items that have the number 2 we would only see:

The CLS expresses this kind of selection as a filter, which is another name for a logic rule. In the screenshot below we have entered a rule (filter) that Number = 2. You can see it at the bottom part of the image. You can ignore the rest of the image, for now…

Filter Building

Filters can be applied to CLS entities in a number of contexts. This explanation uses the example of reporting on the Users entity. We are building a set of rules and combining them together logically in order to select certain Users.

Simple filters

To build a filter:

  1. Click Add filter to create a rule
  2. Choose a Field (for example, Full Name, Active, etc.) from the drop-down box. The fields available will change depending on which entity is being filtered.
  3. Choose an Operator from the drop-down box in the middle
  4. Type a value in the box at the right.
  5. You have now built a rule. You can add another rule (filter) to this top-level rule Group by clicking the top Add filter button (1) again. Notice that this new rule (Active = Yes) lines up with the first rule. Depending on what is selected at the top (5), you are now specifying Users for whom both of these rules are true (AND) or else Users for whom either of the rules is true (OR).
  6. You delete a single rule (filter) by clicking the minus icon at its right hand side.
  7. You can delete all the rules by clicking Delete all filters.

Thus, the screenshot above shows a set of rules that when applied to Users selects those who:

  • Have a Basic User Role, AND
  • Are active (Active = Yes)

Extra Note about Values (4). In some cases, for example when you have specified that “Active =”, you will be provided with drop-down choices, in this case yes or no.

In other cases, for example when you have specified that “Org Unit =“ (see 15 in the screenshot below), an additional drop-down box will appear with Const and Param as choices. You select Const to indicate that you are specifying a value in the right hand box; you select Param to indicate that you are specifying a characteristic in the right hand box.

In this example, choosing Const means that the box displays actual Org Units to select. Selecting Param means that you can choose a relationship, i.e. your own Org Unit.

Rule Groups

  1. You can make rule groups by clicking Add group. This makes it possible to logically build a complex set of filters (but it does require a more technically-oriented person).
  2. After you have clicked Add group (8), new fields and buttons will then appear. You then click the local Add filter button (9) to start create rules for this rule Group. In the example below the rules in the rule group will be logically combined together using AND (14), that is, they must all be true for the whole Group of rules to be true
  3. The outcome of this rule Group will be logically combined with the other rules listed just above it (at 10), i.e. those rules at the same level

This functionality, which can be repeated and combined numerous times and ways, means that rules can be nested in rules that are nested and combined in rules, and so on, leading to highly detailed specifications. As discussed, these are best set up by people, such as programmers, who can design the nested IF statements required.

  1. You delete a Group of rules by clicking Delete Group.
  2. You can delete all the rules (filters) in a Group by clicking Delete all filters.
  3. Click the Control Checkbox next to a rule, if you want the report to pause when it is run to allow this value to be entered. This setting is only applicable to customisable reports.

Thus, the screenshot above now selects those Users who:

  • Have a Basic User Role, and, AND
  • Are active, AND
  • Are in either Organisation Unit 1 OR Organisation Unit 2.

For another example of a targeted set of filters, the screenshot below specifies all Users who:

  1. have a Role of Chief Marker, OR
  2. are in the Org Unit of the User requesting the Report OR
  3. have the first name “Ryan” AND the last name of “Jones”

Note that if the top level field (marked A) was set to “AND” instead of “OR”, then the only User(s) selected would:

  • have a role of Chief Marker, and
  • be in the requestor’s Org Unit, and
  • be named “Ryan Jones”

More Details

Filter Items

A Filter item takes a Property, an Operand and a Value to compare with. The Property is either a property available directly on the entity (e.g. User’s Last Name), or a Custom Attribute. The following properties are available to participate in filtering at the User level (note that for brevity, standard built-in properties are not included):

  • Organisation (select from drop-down or match on Organisation name).
  • Organisation Unit (select from drop-down or match on Organisation Unit name).
  • Main Role (select from drop-down or match on main role name).
  • Last logged on, Last Active, Created – Date Fields related to the user’s account and activity.
  • Custom Attributes – note that it’s possible to specify filters against custom attributes, including Boolean values, string values etc. This makes it possible to create reports targeted at specific demographics.

Operands

Operands are the logical operations. Depending on the datatype of the Filter Property, different operands are available. For example ‘contains’ cannot operate on a Date Type, but it can operate on a Text String. Below are the operands available:

  • = – Equals, available on all data types.
  • != – Does Not Equal, available on all data types.
  • Greater than, available on String (alphabetical order) and Numerical types
  • Contains – Contains operator, only available for Text String Data Type.
  • After – Same as Greater than operator for Data Type.
  • Before – Same as Less than operator for Data Type.

Value to Compare with

The Value to compare with appears in the third column, and changes its input control depending on the data type. For example, for Date Types, it would show a date picker, and for Text it would show a text box. This is the value that the report will use in the filter item to compare with.

Parameters

Some data types support parametric comparison values rather than explicit values. For example, it’s often useful to run a report of Users that logged on during the last week. Rather than selecting a ‘hard’ date (which would need to be updated each time a report is run), it’s possible to select a parameter: “during the last week”. At the time of writing, parametric comparison values are only available for Date Type properties, with the following parameters supported:

  • Today
  • Yesterday
  • This Month
  • This Year
  • Last Month
  • Last Year

Security Filtering

Note that in addition to the filters specified, the system will append further filters based on Security roles of the User who is logged in.