You must have PS Query Manager to edit queries. If you don't have PS Query Manager, please contact DARTS@maine.edu. The DARTS team will be able to edit the query for you.

Click a link below to jump to the topic you would like to learn more about.


Criteria Overview

Criteria, sometimes also referred to as Selection Criteria, specify what records you wish the Query to return. This is the filter that data runs through: only those records meeting the criteria are selected. 
The simplest form of criteria compares the data in a field to a constant value:

  • INSTITUTION = 'UMSYS'
  • ACAD_CAREER = 'UG02'
  • GRADUATION_DATE > 01/01/2005

A field in one table may be compared to a field in another table with similar data and the same format:

  • A.EMPLID = B.EMPLID
  • A.ACAD_CAREER = B.ACAD_CAREER

(Incidentally, this is one of the ways to join two tables together in a query, more on that later.) 
There are four components of Criteria: 
Criteria tab in Query Manager 

Logical

Represents how the criteria rows will be compared with each other. Blank for the first criteria, defaults to AND for subsequent rows. The other options are OR and NOT.

Expression 1

Used to specify what you are comparing. Can be either a field or and expression. This is the left side of the criteria.

Condition Type

States how Expression 1 is compared to Expression 2

Expression 2

This is what Expression 1 is compared to. It can be a constant, field, expression, subquery, or prompt values. This is the right side of the criteria.


Back to top

How to read Criteria

When the query is created with multiple tables or prompts, the Criteria page gets complicated.

Here are the rules on query manager:

  1. When the expression 2 does NOT start with colon ( : ) nor table alias, such as "A." or "B.", it is for a variable. You can change the variable as mentioned above. (see the "Variable Selection" in the screenshot below)
  2. When the expression 2 starts with colon ( : ), it is for prompt. it is usually automatically added when you add a prompt on "Prompt" page. (see the "For prompts" section in the screenshot below)
  3. When the expression 2 starts with table alias, such as "A." or "B.", it is for table join. it is usually automatically added when you joined tables on "Records" page. (see the "Table Join" section in the screenshot below)

Criteria Page Screen

Back to top

Using Criteria

There are a number of ways to add criteria to your query.

Choice #1
If the criteria is for a field that is being displayed, then you can add it from the Fields page: Click the funnel icon Query funnel icon
Highlighted Add Criteria Option on Fields Tab Page

Choice #2
If you are adding criteria for a field that is NOT being displayed in the query results, add the criteria from the Query page using the funnel icon Query funnel icon "Use as Criteria" icon: 
Query Tab Page 

Choice #3

You can go to the Criteria page and click the Add Criteria button:
Highlighted Add Criteria Button 

After choosing the add criteria button or clicking the funnel, the "Edit Criteria Properties" window will show up. See more information in the next section.

Back to top

Expressions and Condition Types

When you are adding a criteria, you will be presented with the Edit Criteria Properties page: 
Edit Criteria Properties Dialogue Box 
If you need to choose a different Record and Field for Expression 1, click the lookup icon Lookup magnifying glass icon and a list like the following will be presented. Select the desired record and field from the list.
Select a Field dialogue box in Query Manager 
Condition Types are used to compare Expression 1 (the left side) to Expression 2 (the right side). Some condition types will change the nature of what is needed on the right side of the Criteria. The Edit Criteria Properties page will change as appropriate. Here's a list of the condition types and what they mean. 

Condition Type

When it Returns a Row

Between

The value in the selected record field falls between two comparison values. The range is inclusive.

equal to

The value in the selected record field exactly matches the comparison value.

Exists

This operator is different from the others, in that it does not compare a record field to the comparison value. The comparison value is a subquery. If the subquery returns any data, PeopleSoft Query returns the corresponding row.

greater than

The value in the record field is greater than the comparison value.

in list

The value in the selected record field matches one of the comparison values in a list. For example, STATE in list ('MA', 'ME', 'VT')

in tree

The value in the selected record field appears as a node in a tree created with PeopleSoft Tree Manager. The comparison value for this operator is a tree or branch of a tree that you want PeopleSoft Query to search.

is null

The selected record field does not have a value in it. You do not specify a comparison value (Expression 2) for this operator. 
Key fields, required fields, character fields, and numeric fields do not allow null values. 

less than

The value in the record field is less than the comparison value.

Like

The value in the selected field matches a specified string pattern. The comparison value may be a string that contains wildcard characters. The wildcard characters that PeopleSoft Query recognizes are % and _.

% matches any string of zero or more characters. For example, C% matches any string starting with C, including C alone.

_ matches any single character. For example, _ones matches any five-character string ending with ones, such as Jones or Cones.

PeopleSoft Query also recognizes any wildcard characters that your database software supports. See your database management system documentation for details.

To use one of the wildcard characters as a literal character (for example, to include a % in your string), precede the character with a \ (for example, percent%).


The entry for Expression 2 depends on the Condition Type you are using. For the basic 'Equal to', 'Greater Than', 'Less Than' it looks like:
Condition type dialogue box showing Condition Ty 
If you're using 'Between' condition type, it will change so that you can enter two values of types Constant, Field or Expressions. (I've always wanted to be able to do a prompt here too!) 
Condition type dialogue box in Query Manager 
The 'In List' allows you to specify a list of constants or point to a subquery which would return a list. 
 
The 'In Tree' lets you point to one or more nodes on a tree. Click the "New Node List" and search by tree name. Expand the tree node to where you want to add and select the node and click OK.
 
The 'Like' condition only allows for constants or prompts:

After finishing adding criteria, go to Criteria page and double check the criteria and logic.

Back to top

Logical Operators AND/OR

Logical Operators (AND, AND NOT, OR, OR NOT) allow you to relate multiple criteria in specific ways. When you specify two or more selection criteria, you need to coordinate the criteria. You can use the Logical column to further define the rows of criteria. The Logical Operator always defaults to AND. The first row of criteria will have a blank operator. When you use multiple criteria, rules of logic apply. The query evaluates criteria that are linked by AND before those linked by OR.

Using these incorrectly will generate quite different results. Consider these examples: 

CriteriaUsing AND

CriteriaUsing OR

ACAD_CAREER equal to GRAD


ACAD_CAREER equal to GRAD
AND


OR


ADMIT_TERM equal to 0410


ADMIT_TERM equal to 0410
Results


Results

EMPLIDACAD_CAREERADMIT_TERM
EMPLIDACAD_CAREERADMIT_TERM
AD1003

GRAD

0410


AD5028

GRAD

0430

AD1005

GRAD

0410


AD1005

GRAD

0410

AD1007

GRAD

0410


AD1084

GRAD

0310





AD1077

UGRD

0410





AD1078

UGRD

0410





AA0012

UGRD

0410





AA0025

UGRD0410

                                                                               

Back to top

Grouping Criteria with Parentheses

Group Criteria controls the order in which query executes the criteria rows. The query evaluates the criteria inside the parentheses before the criteria outside the parentheses. Similar to algebra, the group criteria (x-1)y is indicating that x-1 needs to be solved before multiplying the result by y. Use grouping to funnel data from largest to smallest to expedite search.

Here's an example. 

  1. Click Group Criteria


  2. Type an open and close parenthesis around the criteria rows to be grouped
  3. Click OK

Example 2:

We want to see prospects in the GRAD career for term 0410, or in the MEDS career for admit term 0450. 
Edit Criteria Grouping dialogue box 
Results:
Results of grouping using parenthesis 

Back to top

Step-by-Step Example: Creating and Deleting Criteria

  1. Navigate to Query Manager
  2. Find the query you would like to change and click "Edit".

    Highlighted Edit for Query

  3. Select the "Criteria" tab and click "Edit" for the criteria you want to change. In this example, we want to change the departments that will show in the report. Click the "Edit"  button for DEPTID.

    Highlighted Criteria Tab

  4. After clicking Edit, the Edit List dialogue box appears. Click the small magnifier glass and a new window will pop up. If you want to add new value, enter a value on the box and click "Add Value" bottom. If you want to delete an existing value, check the small box next to the value and click "Delete Checked Values." After finishing adding or deleting, click "OK" to close the window.
    Edit List Screen

  5. If you want to delete the entire criteria completely, use delete icon next to "Edit".
    Highlighted Square Minus Button Indicating Deletion

  6. Save the query using "Save As" with different name.

Back to top

PeopleSoft Version Notice

Depending on the version of PeopleSoft you are using, your screens may look slightly different than some of the images shown on this page, however the basic instructions are the same.

Attachments:

image2017-12-12_12-42-58.png (image/png)
image2017-12-12_12-52-15.png (image/png)
image2017-12-12_13-26-22.png (image/png)
image2017-12-12_13-28-37.png (image/png)
image2017-12-12_13-30-53.png (image/png)
image2017-12-12_13-34-22.png (image/png)
image2017-12-12_13-35-37.png (image/png)
image2018-2-22_14-36-27.png (image/png)
worddav1ffba925a5c4075888b5833f39245512.png (image/png)
worddave6eccc7d873ff7388a52de10593f610b.png (image/png)
worddava3c6e987058fc3195c45249d481dcc44.png (image/png)
worddav1aef6ba966611fcd3970e2f9ab35c97c.png (image/png)
worddav80eab63846da134ff93548a79f0fe2a1.png (image/png)
worddav8f820c9d0e47bdef46b3505e531655eb.png (image/png)
worddav516be5fa5a88a90b69d8535a8229f1cd.png (image/png)
worddav1b85c734896b69abf20d5e3cd0972577.png (image/png)
worddav87d4450cd24c08fba4908b5f8aba0043.png (image/png)
worddavb1fc38047c3723eafa66629f5327ad8c.png (image/png)
worddav1bc32e83b4bcf0f22210a18f1077d140.png (image/png)
worddavdc1795ac37c7b5e3e6731bca2a7f2013.png (image/png)
worddavfb01e6a812038f0767914d8e66c6b593.png (image/png)
worddav6020e18c0375b53a7b72f3976f3b0a00.png (image/png)
worddav03ac634308a4763fd65fc68c0e58bf97.png (image/png)
worddava7a15636c65b2e03be021fa14859c337.png (image/png)
worddav305ce9ef5389319d22711c7b8b2ac8f2.png (image/png)
worddave746ff9a5c958f05bfa468e4381fde86.png (image/png)
worddavf9f53c469535daf77509f9bb63bad1af.png (image/png)
worddav570c712f17bdfebea18639c9569c3d45.png (image/png)
worddavc1f27e6433247945a9cefcd68a7c1dbb.png (image/png)
worddav7f390470e434bf220635d72da90d4617.png (image/png)
worddav7f390470e434bf220635d72da90d4617.png (image/png)
image2017-12-8_12-4-16.png (image/png)
image2017-12-8_12-6-15.png (image/png)
image2017-12-8_12-6-15.png (image/png)
image2017-12-8_12-8-44.png (image/png)
image2017-12-8_12-12-14.png (image/png)