Query Builder Window

<< Click to Display Table of Contents >>

Navigation:  Using Cimera > Searching and Querying > Querying >

Query Builder Window

Previous pageReturn to chapter overviewNext page

The Query Builder Window uses simple or complex criteria to find items in the Cimera Database.

 

The Query Builder Window can be launched by

Selecting Menu > Query > Query name

Selecting Menu > Query > New Query (Query Builder)

Selecting Advanced from the Simple Query window

Selecting Edit from the Manage Queries window

 

 

Query - Builds

 

 

Name

 

A query can be saved by giving it a name a pressing Save.  It will then be available from the Main menu by selecting Main Menu > Query > Name

 

Menu-Query-existing query

 

It can also be accessed from the Manage Queries window

 

 

Save Query

 

Save the current query

It is saved on the local machine in the client settings under C:\Users\<user>\AppData\Roaming\Propel Systems\Cimera\CimeraClient.config

This means that (currently) queries are specific to a user and a machine though they will be more flexible in a future release.

 

 

Run Query

 

Query the Cimera Database for all Items of the selected Item Type meeting the specified criteria.

 

 

Item Type

 

Select the Item Type you wish to search.  The Item Type selected will determine which attributes are available to specify criteria against.

Some Item Types are Inherited by other Item Types (see Item Type Inheritance), if the selected Item Type is inherited then all its descendant Item Types are also searched.

 

For example select Item Type "Computer" to search all "Desktops", "Laptops" and "Servers"

 

If an Item Type is not creatable (see Item Type Inheritance) then it will appear in italics.

 

 

Items

 

If the Item Type selected is not versionable then the Items option will always be selected (see Versions)

 

 

Items or Versions

 

If the Item Type selected is versionable then there will be an Items or Versions option.

Select whether you are searching for Versions or the Item Stems of Versions.

 

If Items is selected then only the Stem attributes will be available.

If Versions is selected then the attributes of both the Item Stem and the Version will be available to specify criteria against.

 

If Stem fields are selected then if an Item Stem meets the criteria then all its versions will be included.

If Version fields are selected then all Versions that meet the criteria, irrespective of the Stem, will be included

If both Stem and Version fields are selected then the Versions will only be included if their Stem meets the Stem criteria and the Version meets the Version criteria.

 

 

Clear

 

Remove all criteria

 

 

Query Syntax

 

The Cimera Query Builder uses a kind of polish notation (or prefix notation) to specify the criteria. i.e. the operator is specified BEFORE the operands it applies to, and not in between them.

 

For example

 instead of a sum being written as 1+2+3 it would be specified as +1 2 3

 

 the expression

         reference=123 AND (colour=green OR day=Monday OR Status=Closed)

 

 would be expressed as

         AND        reference=123 OR (colour=green, day=Monday, Status=Closed)

 

 or with different formatting

         AND        reference=123

                 OR        colour=green

                         day=Monday

                         Status=Closed

 

 

Boolean Expressions

 

The Query Builder only uses the boolean operators AND, OR, NOT so expressions are in the format:

 

BooleanOperator (condition1, condition2, condition3,…)

 

Where "condition" returns either TRUE or FALSE

 

For example

 

AND (2>1 , 3>4 , 6>5)        returns FALSE

OR (2>1 , 3>4)        returns TRUE

 

AND (Condition1, Condition2, OR (Condition3, Condition4, Condition5))

returns TRUE if Conditions 1 and 2 are both TRUE and at least one of Conditions 3, 4 or 5 are TRUE

 

AND (9>8, OR (2>1 , 3>4) , 6>5)        returns TRUE

 

 

 

Building the Query

 

There are 3 main parts to an expression

 AND

 OR

 Condition

 

 

Add AND

 

Create a new boolean AND statement (See Boolean Expressions below).

This option is only available if an "OR" statement is high lighted (it makes no logical sense in any other context)

 

 

Add OR

 

Create a new boolean OR statement (See Boolean Expressions below).

This option is only available if an "AND" statement is high lighted (it makes no logical sense in any other context)

 

 

Add Condition

 

Create a new condition for the parent AND or OR statement (See Boolean Expressions below)

 

This will bring up the Add Condition window which will allow the user to select

 

1.the field they wish to test

2.the condition

3.the value to compare it against.

 

The latter 2 are customised depending on the Attribute Type of the field selected.

 

 

NOT

 

Negate the selected condition.

For example if you wanted the Items with Names that did not start with an "a" then set the condition to be "Name starts with a" and then negate it.

 

 

Remove

 

Delete the selected boolean condition

 

 

Search Results

 

A list of all Items meeting the criteria, populated when the Run Query button is pressed.

The Filter affects what is displayed, it does not affect what is returned from the Database. See Item List Filter

 

 

Note

 

The Query Builder Window only searches the Cimera Databases, it does not search the Item Library which holds file attachments.

It does not search long text fields such as the History Box and Text Box (See Attribute Types)

 

 

See Also

CQL Query

Differences between Query Builder and CQL