Introduction to PeopleSoft Query.ppt

Embed Size (px)

Citation preview

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    1/127

    1

    INTRODUCTION TOPEOPLESOFT

    QUERY

    Revised: August 2008

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    2/127

    2

    OVERVIEW

    PeopleSoft Query

    Basic ad hoc reporting tool

    Allows you to write ad hoc queries and also run queries

    shared by others Allows data to be extracted to Excel

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    3/127

    3

    BASIC QUERY

    Six steps to creating a basic query1. Select the data record(s)

    2. Select the field(s)

    3. Set the query criteria

    4. Edit the field properties (optional)

    5. Save the query (optional)

    6. Run the query

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    4/127

    4

    SAVED QUERY

    You can access and run queries that you or others havesaved in the past Public Queries are queries that you (or others) have saved which are

    accessible by anyone

    Private Queries are queries that you have saved which are only accessible by

    you

    When using a Public Query: If you did not create the query: always save the query under a new name

    before making any changes OK to Run a Public Query as is without saving it under another name

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    5/127

    5

    NAVIGATING TO QUERY: Reporting Tools > Query > Query Manager

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    6/127

    6

    Using a Saved Query

    Follow along with me on this exercise

    Navigate to:Reporting Tools > Query > Query Manager

    Enter EM in the Begins with search box

    Click on Searchbutton

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    7/127

    7

    Note:

    The list of query names & descriptions

    Ownership (Public or Private)

    Edit, Run to HTML, and Excel hyperlinks

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    8/127

    8

    You can open an existing query by clicking on the Edit hyperlink for the query you want torun

    Using the Action drop down box you can delete, move to folder, rename or copy a query tosomeone else

    Do NOT delete or rename a query that was created by someone else

    Click on EMP_LIST_SEN_BRTH_JMS

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    9/127

    9

    This takes us to the Fieldstab of the query

    Well take a closer look at this later

    Click the RunTab

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    10/127

    10

    Query Results:

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    11/127

    11

    Wow!

    You can now format your report as younormally would with any other Excelspreadsheet, save the report or e-mail itto someone.

    Close the window

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    12/127

    12

    Alternate Execution Method

    Click the HTML hyperlink for the query you want to run

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    13/127

    13

    Query Results

    Note the report heading

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    14/127

    14

    Creating a New Query

    Follow along with me on this exercise

    Navigate to:

    - Reporting Tools > Query > Query Manager

    - Click on Create New Query

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    15/127

    15

    Record Selection

    The first step is to select a data record

    Note the search options:

    Search By (defaults to Record Name) Use Drop down box to see other options

    Enter Personalin the search box to find the Personal Data record

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    16/127

    16

    NOTE:

    Record name description

    Add Record hyperlink to select the record for this query

    Show Fields hyperlink to view the fields in the record

    Find the PERSONAL_DATArecord & click Add Record

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    17/127

    17

    Note:

    Folder icon

    Alias Record

    Hierarchy Join

    Minus Button

    Fields:

    Check box(es)

    Key Symbol

    Field namesCriteria icon

    Join Record Names

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    18/127

    18

    Select the Fields

    Click on the checkboxes for the following fields: EMPLID

    NAME

    SEX

    Birthdate

    Click on the Fieldstab

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    19/127

    19

    Col

    Record.Fieldname Format

    Ord XLAT

    Agg Heading Text Add Criteria Edit

    Delete

    NOTE the following headings:

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    20/127

    20

    Edit Field Properties

    Locate the SEXfield

    Select Edit

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    21/127

    21

    Your edit choices:

    Heading

    No Heading

    Text

    RFT Short

    RFT Long

    Heading Text

    Unique Field Name

    Aggregate values

    Translate Value

    None

    Short

    Long

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    22/127

    22

    Edit the data as follows:

    Heading: Text

    Heading Text: Gender

    Aggregate: None

    Translate Value: Short

    Click OK

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    23/127

    23

    Click on Reorder/Sort

    Move Birthdate to Col 3

    In the New Order By column: Make Sex sort order 1

    Click OK

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    24/127

    24

    Note the following changes: The Birthdate field has moved above the Sex field

    The sex field is now designated as the primary sort

    The short translate value will be displayed rather than a code

    Column heading will show as Gender

    Edit a few more field properties for practiceEdit field EMPLID

    Heading Text: Employee ID

    Order By: 1

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    25/127

    25

    Select the View SQL tab

    The query tool automatically generates SQL (Structured Query Language) code

    SQL will look familiar to those of you who wrote queries in the past using QMF and is usefulfor advanced users in troubleshooting problems with a query.

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    26/127

    26

    Saving Queries

    Once you have created a query,

    you may want to save it prior torunning it.

    Click SAVE (naming standardsfollow)

    Enter: Query Name

    Description

    Owner

    Private

    Public

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    27/127

    27

    Naming Standards

    Spaces & special characters are NOT allowed

    All query names should begin with OX followed by:

    Department abbreviation (e.g. BN for Benefits)see PS Query Help HomePage

    Descriptive name

    Initials of the person who created the query

    Example:

    OX_Department Abbr_Descriptive Name_Initials

    OX_BN_Employee_Listing_KP

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    28/127

    28

    Enter:

    Query Name: OX_GBLCO_EE_LIST_INITIALS

    Description: General Info About Employees

    Owner: Public

    Click OK

    Then click the Propertieslink (at bottom)

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    29/127

    29

    The Properties page allows you to maintaindescriptive information related to the query:

    Query Name, Description and Owner

    defaulted from the Save Page Query Type defaults to User

    Distinct checkbox eliminates duplicate rows(sporadic - current problem in Oxy PS environment)

    Query Definition allows furtherdocumentation about the query

    Status Box displays the history of the last

    save of the query

    Click OK & then Run to execute the query

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    30/127

    30

    Examine your data Note the Download to Excel option

    Close this window by clicking the X in the upper right corner

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    31/127

    31

    Saving a query as a favorite

    After you create your query:

    Click the Return to Search button

    Enter the query name in the search box:

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    32/127

    32

    Saving your query as a favorite

    Check the Select box

    Click on the Action drop down arrow

    Select Add to Favorites

    Click GO

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    33/127

    33

    Key Points

    There are six steps to creating a query:

    Select the record(s)i.e. Data Tables Select the data field(s)

    Set the query criteria

    Edit the field properties (optional)

    Save the query (optional)

    Run the query

    For translate fields, the long or short descriptions can be displayed rather than the code

    Queries can be saved as public or private

    The SQL statement generated by a query can be viewed by selecting the View SQLtab(for advanced query users)

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    34/127

    34

    Individual Activity #1

    You have been asked to create a query that displays the hire and termination dates of all

    employees and eliminate duplicates (see page 29).

    Record EMPLOYMENT

    Fields/Headings EMPLID Employee ID

    HIRE_DT Hire Date

    TERMINATION_DT Termination Date

    LAST_DATE_WORKED Last Date Worked

    SUPERVISOR_ID Supervisor ID

    Order by TERMINATION_DT descending

    Query Name HIRE_TERM_QRY

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    35/127

    35

    Did you remember to:

    Change field headings Order by termination date in decending order

    Click on the New Queryhyperlink

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    36/127

    36

    Individual Activity #2

    You have been asked to produce an updated list of employees emergency contacts.

    Record EMERGENCY_CNTCT

    Fields/Headings EMPLID Employee ID

    CONTACT_NAME Contact Name

    RELATIONSHIPRelationship (short translatedescription)

    PRIMARY_CONTACT Primary Contact

    PHONE Phone

    Order by EMPLID

    CONTACT_NAME

    Query Name EMER_CNTCTS

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    37/127

    37

    Did you remember to:

    Change headings? Use short translate value for Relationship?

    Order by EmplID and Contact Name?

    Click on the New Queryhyperlink

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    38/127

    38

    Selection Criteria

    Next, we will add criteria rows to a query to return specific rows of data

    Compare fields to find data matching a specific selection criteria

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    39/127

    39

    Selection Criteria

    Create a basic query to capture employee data and save the query withoutrunning it.

    Record PERSONAL_DATA

    Fields NAME

    EMPLID

    MAR_STATUS (short description)

    Order by NAME

    Query Name/Description CRITERIA Criteria for Employees

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    40/127

    40

    Did you remember to make the following field edits?

    Change Name to the first field and sort by name?

    Use the Short Name for the Mar_Status translation type?

    Name the query and give it a description?

    When youre ready, click the Criteriatab and then the Add Criteria button.

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    41/127

    41

    Choose Expression 1 Type:

    Used to specify what you are comparing

    Field

    Expression (i.e calculation)

    NOTE:

    Your selection of Expression 1 Typechanges the display for Expression 1 on theright

    Expression 1:

    Select the field (or Expression) you wantto compare

    Field

    Expression

    Next well consider Condition Type

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    42/127

    42

    Condition Types

    Between Not between

    Equal to Not equal to

    Greater than Not greater than

    In list Not in list

    In tree Not in tree

    Is null Is not null

    Less than Not less than

    Like Not like

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    43/127

    43

    Note the different Expression 2 Types:

    Field Expression

    Constant

    Prompt

    Subquery

    Click the Cancel button

    Click the Querytab

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    44/127

    44

    Find the field: Sex

    Click the Add Criteriaicon

    (funnel)

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    45/127

    45

    Select Condition Type: equal to

    Expression type: Constant

    Expression 2: F

    Click OK

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    46/127

    46

    You can apply criteria to fields that are not included in the query output

    You need to know how the data is stored in the database to ensure accurate resultswhen the query is run

    Click Savethen Runto view the output

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    47/127

    47

    RESULTS

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    48/127

    48

    In addition to your current criteria, we now want to narrow the selection to retrieve onlythose employees who have the capital letter D in their first name, middle initial or last

    name.

    From the Criteriatab, click the Add Criteriabutton

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    49/127

    49

    Select Expression 1 Type: Field

    Expression 1: Click on the Searchicon

    Select Namefield from the list

    Condition Type: like

    Expression 2 Type: Constant

    Expression 2: %D%

    The Like operator is case sensitive anduses wildcard characters to search fordata

    Wildcard characters are:

    % Any string of zero or morecharacters

    __ (underscore) Any single character

    Click OK

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    50/127

    50

    Click Save

    Click Run

    NOTE the Logical drop down list (And/Or) for your criteria

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    51/127

    51

    You now have a female employees who have a capital D in their name

    RESULTS

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    52/127

    52

    Individual Activity #3

    Produce a list of all employees whose Business Title contains the word Manager. Also,

    only show those who were hired after 1989.

    Record EMPLOYMENT

    Fields EMPLID

    BUSINESS_TITLE

    HIRE_DT

    Order by HIRE_DT (descending)

    Query Name/ Description Business_Title Manager Business Title Query

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    53/127

    53

    Results:

    NOTE: Some fields are case sensitive which will impact your results

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    54/127

    54

    Criteria page

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    55/127

    55

    Effective Dates

    Effective dated records are those records that contain the field EFFDT. The effective date provides a history of changes over time

    There are three categories of effective dates:

    History

    Rows of data where the Effective Date is less than the Effective

    Date of the current row.

    CurrentThe row of data with the highest effective date/sequence numberless than or equal to todays system date.

    FutureRows of data where the Effective Date is greater than todays

    system date.

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    56/127

    56

    Effective Dates

    Effective Dates are used in a query as criteria to select a specific population.

    When you start a new query and select an effective-dated record/data table, a dialog boxwill display informing you that an effective-date criteria row has been automaticallycreated.

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    57/127

    57

    Effective Dates

    Click the New Query link

    Record: JOBCODE_TBL

    Click Add Record

    Click OKin dialog box

    Select the Criteriatab

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    58/127

    58

    Click the Editbutton

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    59/127

    59

    Four effective dated comparisons:

    Effective Date =

    Do NotUse:

    First Effective Date

    Last Effective Date

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    60/127

    60

    Individual Activity #4

    Create a query that lists the last current job actions as of the current date for your employees.

    Record JOB

    Fields/Headings EMPLID ID

    DEPTID (column 2) Dept ID

    JOBCODE Job Code

    ACTION (short description) Action

    ACTION_REASON Reason

    EFFDT Effective Date

    LOCATION Location

    ANNUAL_RT Annual Rate

    Order by EMPLID

    Criteria Annual salary of $50,000 or more (enter 50000)

    Compensation Frequency of monthly (Enter M)

    Query Name OX_BN_CUR_ACTION_XX

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    61/127

    61

    Fieldstab

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    62/127

    62

    Criteriatab

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    63/127

    63

    Results

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    64/127

    64

    Using Aggregate Functions

    Five aggregate functions are available:

    Average

    Count

    Max

    Min

    Sum

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    65/127

    65

    Sample Aggregate Query

    Build a very simple query to list Employee IDs for employees in thePERSONAL_DATA record (or data table)

    Record: PERSONAL_DATA

    Fields: EMPLID

    Query Name: EMPLNUM

    Save

    Run to see how many rows are returned

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    66/127

    66

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    67/127

    67

    Now add the aggregate function to count the number of employees.

    Click Fieldstab

    Click Editbutton

    Aggregate: Count

    Click OK Click Save

    Click Run

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    68/127

    68

    Results

    NOTE: Only one row is returned with a count of the number of Employee IDs.

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    69/127

    69

    Advanced Topics

    Multiple Table Queries

    Prompted Queries

    Writing Expressions

    M lti l T bl Q i

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    70/127

    70

    Multiple Table Queries

    PeopleSoft Query Manager allows you to join data from more than onerecord/Data Table

    You can join multiple records using the web-based Query Manager

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    71/127

    71

    Tables and Views

    Records listed in the Record Search may represent either a Table or a View.

    A Table physically stores specific data.

    A View is a compilation of data that is usually retrieved from multiple tables. This canbe considered as pre-joined tables.

    Some Views may already have criteria associated with them.

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    72/127

    72

    Joins

    A join allows you to retrieve data from two or more records/Data Tables -or- specify

    criteria from more than one record/table

    Whenever you perform a join, the records are linked based on common fields.

    In Query, pre-defined joins can be generated as either a Hierarchical join or a RelatedRecord join.

    You do not have to add any criteria for pre-defined joins in order to link the records.

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    73/127

    73

    Types of Joins

    Record

    Hierarch

    A Hierarchical join uses records that are parents or children of each other.The hierarchical relationship is defined by the Parent Record in the

    Application Designer.

    Example: Joining employee Personal data with Dependent/Beneficiary data.

    Related

    Record

    Related Record joins use records from non-hierarchical records/tables thatare related by a common field.

    Example: Description tables for common codes are related records. Thisrelationship is determined by the Prompt Table edit defined for a field in the

    Application Designer.

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    74/127

    FIELDS Tab

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    75/127

    75

    FIELDS Tab

    Return to RecordsTabType in Job & Select the Join Record link next to the Job table

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    76/127

    76

    Click on the A=Person_Name link

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    77/127

    77

    The Emplid (Key in both records) fields are automatically linked together to jointhe Person_Name record with the Job record

    Click on the Add Criteriabecause this is the join you want.

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    78/127

    78

    The job record has become part of the query and is joined to the Person_Namerecord.

    NOTE: The Alias ID for the Person_Name data table is A and the Alias ID for theJob data table is B.

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    79/127

    79

    Select the following Fields from the JOBrecord:EMPL_STATUS, LOCATION, AND BUSINESS_UNIT

    NOTE: You may have to use the Find search option

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    80/127

    80

    Joining Base Tables to Control Tables

    Control tables are shared by all divisions and sometimes need to be joined usingmultiple keys or fields.

    Many control tables have a Setid field that is used to match the Setid for the divisionaccessing the table.

    Most control tables also have an Effective Date that should be considered whenjoining to another base table.

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    81/127

    81

    Many fields that have associated tables have a link next to them that allows the userto click and automatically join this table to this field.

    In this example we will join the Location_Tblcontrol table to the Location field inthe Job record.

    Click on the Join LOCATION TBLlink & click OK to the pre-selected join.

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    82/127

    82

    Now the three tables are joined together (Person_Name, Job & Location_Tbl).

    Select the DESCRField in the Location table and go to the Criteria tabin the query.

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    83/127

    83

    Here you see that the base tables have been joined together and the Effective Dates are setto look at the most current row in the record. Because you used the join link for the locationtable you do not see the joining of the location field in job with the location field in the control

    table. However, it is done automatically for you in the background. This can be seen if youlook at the SQL tab.

    NOTE: Because it is a control table, a manual join of the Setid should be done to eliminatethe chance of duplicate values for the same field.

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    84/127

    84

    Select the Criteria tab& click on the Add Criteriabutton to create a new criteria to join theSetid field in the Location record with the Setid for location in the Job record.

    The fields to be joined are shown in the example above.

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    85/127

    85

    Now we need to go to the Fields taband edit our fields.

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    86/127

    86

    Add criteria on EMPL_STATUSto select only values of A, L, P.

    Use the short translate value for the status code.

    Move the Location Description next to the Location Code

    Rename the Location heading text to read: Location Descr

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    87/127

    87

    Prompted Queries

    PeopleSoft Query allows you to build reports that contain runtime prompts.

    A runtime prompt allows you or another user to enter a value for a specific field at the timethe query is run.

    The report will display only those data rows that match the criteria entered in the prompt.

    This makes the query dynamic, allowing it to be used over and over again withoutmodifying the query to meet changing requirements.

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    88/127

    88

    Runtime Prompts

    Record DISABILITY_BEN

    Fields EMPLID

    PLAN_TYPE (short description)

    COVERAGE_BEGIN_DT

    COVERAGE_ELECT (short description)

    BENEFIT_PLAN

    Order by EMPLID

    Query name DISABILITY

    Create the following query to retrieve employee disability election information.

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    89/127

    89

    Your Fields tab should look like this.Savethe query and Runit.

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    90/127

    90

    Results

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    91/127

    91

    A prompt is another type of criteria and it can be added from two locations: From either the

    Fields tab or the Prompts tab. Click the Prompts tab

    The Prompts tab can be used to add runtime prompts and display a list of all prompts thathave been added to the query.

    The Fields tab is the most common method of adding criteria and is useful when only addingone runtime prompt.

    Click the Fields tab

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    92/127

    92

    For field PLAN_TYPE, click the Add Criteriaicon.

    Expression 2 Type: Prompt

    Expression 2: New Prompt

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    93/127

    93

    Select Heading Type: RFT Long

    Heading Types are:

    RFT Long Long field name

    RFT Short Short field name

    Text Anything you want

    Type, Format and Length all default from the fielddefinition in the database.

    Edit Types:

    No table edit

    Prompt Table

    Translate Table

    Yes/No Table

    Prompt Name is used in translations. No needto change this field.

    Click OK twice

    Click on the Fields Tab

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    94/127

    94

    Note that a prompt has been added and is represented as a bind variable. Click Save

    Click Run

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    95/127

    95

    A prompt is displayed allowing you to select or enter your criteria

    Select Long-Term Disability

    Click OK

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    96/127

    96

    By using a prompt, the query is dynamic based on the Plan_Type chosen for each run.

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    97/127

    97

    To add a prompt for an additional field, such as coverage election, you would simply addanother row of criteria.

    Click the Fields tab

    Click the Add Criteriaicon for the COVERAGE_ELECT field

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    98/127

    98

    Choose Expression Type 2: select Prompt Examine the Define Prompt section of Expression 2

    In Expression 2, select the New Prompthyperlink

    Prompt Will display the bind variable or prompt name used for this criteria

    Search Icon Will display all prompts created for this query

    New Prompt Select this hyperlink to create a new prompt to be used for this row of criteria

    Edit Prompt Use this hyperlink to edit the existing prompt used for this row of criteria

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    99/127

    99

    Heading Type: RFT Long

    Click OK

    Click OK

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    100/127

    100

    Examine Criteria tabfor new criteria row

    Click Save

    Click Run

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    101/127

    101

    You now have two prompts that will be used in your criteria.

    Select Plan Type prompt: Long-Term Disability

    Select Coverage Election prompt: Elect

    Click OK

    Results

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    102/127

    102

    Results

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    103/127

    103

    Runtime PromptsExample #2

    Record Health_Benefit

    Fields Emplid

    Plan_Type Short description

    Coverage_Begin_Dt

    Coverage_Elect Equal to E

    Benefit_Plan

    Order By Emplid

    Query Name OX_GBLCO_MEDICAL

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    104/127

    104

    Your Fields tab should look like this.

    Savethe query and runit

    Results

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    105/127

    105

    Results

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    106/127

    106

    Now, we will add a prompt to the query:

    Reminders:

    You can add a prompt in two ways:

    - Using the Prompts tab

    - Using the Fields tab (most common method when adding one runtime prompt)

    Click on the Fieldstab

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    107/127

    107

    For Plan_Type: Click the Add Criteria Icon

    Expression 2 Type: Prompt

    Expression 2: Click New Prompt

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    108/127

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    109/127

    109

    Go to the Criteria tab: Note that a prompt has been added and is represented as a bindvariable.

    Click Save

    Click Run

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    110/127

    110

    A single prompt is displayed for you to select your specific criteria for the population youwant to retrieve

    Select Medical

    Click View OK

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    111/127

    111

    With the prompt, the query is dynamic based on the Plan_Type selected at run time.

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    112/127

    112

    To add a prompt for an additional field, such as coverage election, (which youve already

    coded in the criteria), simply add another row of criteria.

    Click the Fields tab

    Click the Edit button for the Coverage_Electfield

    Expression 2 Type: Prompt

    Expression 2: New Prompt

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    113/127

    113

    Heading Type: RFT Long

    Click OK

    Click OK

    Examine Criteria Tabfor new criteria row

    Click Save

    Click Run

    Select Plan Type: Medical

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    114/127

    114

    Select Coverage Election: Elect

    Click OK

    View RESULTS below.

    Prompt Summary

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    115/127

    115

    Creating Prompts:

    Editing Promptsonce created, you can view them via one of the methods above

    Deleting Prompts:

    To delete a prompt, access the Prompts page and click the delete button(minus sign) for the prompt you wish to delete. If you are using the prompt in arow of criteria, you must remove it from the criteria before deleting it.

    Prompts Tab Useful when adding multiple prompts to one query

    Criteria Tab Useful when adding only one prompt to a query for a specified field

    Prompts Tab Click Edit button for the prompt you wish to edit.

    Criteria Tab Click Edit Prompt hyperlink to edit the prompt.

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    116/127

    116

    Writing Expressions

    Record Personal Data

    Fields/Headings Emplid ID

    Name Employee Name

    Sex Gender(short desc)Birthdate

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    117/127

    117

    Your Fields screenshould look like this.

    Did you remember:- To change the description of name and sex

    - To add the short description to sex

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    118/127

    118

    Select the Expressions tab

    Click on Add Expression

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    119/127

    119

    Change the expression Type to Number

    Use 3as the Length

    Click on the Add FieldLink

    Choose Birthdatefrom the select list

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    120/127

    120

    Formula (calculates age as of the current date):Datediff(mm,A.BIRTHDATE,getdate())/12

    Insert/Enter the formula shown belowin the Expression Text box

    Click OK

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    121/127

    121

    Click on the Use as Fieldlink to include this expression to your query results

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    122/127

    122

    Change the Heading Texton the expression Line (Line 5) to AgeClick on the Runtab

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    123/127

    Addi E i C it i i th Q

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    124/127

    124

    Adding an Expression as Criteria in the Query

    Choose the Fields tabClick on the Add Criteriaicon for the expression line (Line 5)

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    125/127

    125

    Expression 1 Type: Expression

    Expression 1: shows Expression

    (NO change required)

    Condition Type: Greater than

    Expression 2 Type: Constant

    Expression 2: 35

    Click OK

    Click on the Criteria tab

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    126/127

    126

    The expression is now part of the criteria.

    The query will only select employees over the age of 35

    Hit the RunTab

  • 8/10/2019 Introduction to PeopleSoft Query.ppt

    127/127

    Results