23
Table of Contents Introduction to PeopleSoft Query...............................2 Overview of Query Viewer......................................3 Search for a Query.......................................... 3 Run a Query................................................. 6 Run a Query with a Prompt...................................8 Sort Data in Excel.......................................... 9 Overview of Query Manager....................................10 View Tables and Fields in a Query..........................10 Edit a Query............................................... 12 Add/Delete Criteria........................................ 13 A Brief SQL Discussion..................................... 16 Request a New Query or Changes to an Existing Query..........17 Jake Abrams Software Consulting, Inc Oct.08 http://sites.google.com/site/jascinc/Home

Peoplesoft Row Level Security

Embed Size (px)

Citation preview

Page 1: Peoplesoft Row Level Security

Table of Contents

Introduction to PeopleSoft Query................................................................................2

Overview of Query Viewer.........................................................................................3

Search for a Query..................................................................................................3

Run a Query.............................................................................................................6

Run a Query with a Prompt....................................................................................8

Sort Data in Excel...................................................................................................9

Overview of Query Manager....................................................................................10

View Tables and Fields in a Query......................................................................10

Edit a Query...........................................................................................................12

Add/Delete Criteria................................................................................................13

A Brief SQL Discussion........................................................................................16

Request a New Query or Changes to an Existing Query......................................17

Jake Abrams Software Consulting, Inc Oct.08http://sites.google.com/site/jascinc/Home

Page 2: Peoplesoft Row Level Security

Introduction to PeopleSoft Query

At <Client>, PeopleSoft software is used to run the Human Resources, Financial Administration, and Student Administration systems. PeopleSoft has multiple reporting tools that enable users to retrieve data from the production system including:

Query Manager – Enables users to easily build and run SQL queries directly against the PeopleSoft database.

Query Viewer – Enables all users to run PS Query reports.

Crystal Reports – A reporting tool that enables report writers to format data from PS Query reports into an easily readable layout.

SQR – A programming language that enables a report writer to build formatted reports.

nVision – A PeopleSoft reporting tool used to create financial statements for the Financials system.

Crystal Reports, SQR, and nVision are all run from specific run control pages. In order for a user to have access to run these reports the user must have access to view and modify the run control pages.

The Query Manager tool is only available to those users that have good knowledge of SQL, relational databases, and are deemed qualified by the IT department.

However, every user has access to the Query Viewer tool. This class will focus on three main goals:

1. Give an overview of the Query Viewer tool and teach users how to run query reports from this tool.

2. Give a high level overview of the Query Manager tool so that users will understand the limits of this tool when they request a report.

3. Introduce a form for requesting new or modified queries and discuss how to fill out the form.

Jake Abrams Software Consulting, Inc Oct.08http://sites.google.com/site/jascinc/Home

Page 3: Peoplesoft Row Level Security

Overview of Query Viewer PeopleSoft’s Query Viewer tool enables you to run query reports and output the results to multiple formats including excel, CSV, or HTML. The Query Viewer tool does not allow you to create or modify query reports in any way.

At <Client> there are many existing queries that users can run in the Human Resources, Student Administration, and Financial Administration systems. All query reports can be run from the Query Viewer tool.

The first step in using the Query Viewer tool is to navigate to the Query Viewer page.

Search for a QueryWhen you access the Query Viewer tool, the first page you will be taken to is the Query Viewer search page. On this page you can search for a query to run by entering some data into the search field and choosing from the criteria dropdown.

Jake Abrams Software Consulting, Inc Oct.08http://sites.google.com/site/jascinc/Home

Page 4: Peoplesoft Row Level Security

In this example we will look for a <Client> custom query. Choose the option of “Query Name” from the “Search By” field. Enter the value “PCC” and click search.

Tip - All queries written specifically for <Client> will start with 'PCC'.

Jake Abrams Software Consulting, Inc Oct.08http://sites.google.com/site/jascinc/Home

Page 5: Peoplesoft Row Level Security

You can also use the Advanced Search page to find queries to run.

If you find a query that you know you will want to run at some point in the future you can set it as your ‘Favorite’. Set a query as your favorite by clicking the ‘Favorite’ link.

Jake Abrams Software Consulting, Inc Oct.08http://sites.google.com/site/jascinc/Home

Page 6: Peoplesoft Row Level Security

When you add a query as a favorite, the query will always show up at the bottom of the page when you navigate to the Query Viewer page.

Tip – Set queries that you run often as your favorites.

Run a QueryAfter you search for a query you will see a list of queries in the search results. Pick out the query that you want to run.

You can either run the query to HTML or to Excel by clicking on either the “Run to HTML” or “Run to Excel” links.

Tip – You may want to run the query to HTML before you run the report to Excel so that you can verify that the query is returning the data you are looking for.

Jake Abrams Software Consulting, Inc Oct.08http://sites.google.com/site/jascinc/Home

Page 7: Peoplesoft Row Level Security

If you run the query to HTML the system will open another browser window with your query results. From the HTML browser window you can also download the query results into Excel or a CSV file.

If you run the query to Excel or if you download query results into Excel from the HTML window, then the results of the query will open in an excel window. The query tool automatically formats the results for Excel.

Download the query results to Excel.

Jake Abrams Software Consulting, Inc Oct.08http://sites.google.com/site/jascinc/Home

Page 8: Peoplesoft Row Level Security

Query to Excel results

Tip - After your query results have downloaded to Excel you should use the “Save As” Excel function to save the query with a specific name and to a specific location that is useful to you.

Run a Query with a PromptSome queries that you run may have prompts. Prompts are used as run-time criteria so that you will be able to limit the result set to specific values that you enter. For example, date prompts are often used to enable the user to select data from a specified date range.

When you run a query report that has prompts a page will display where you will need to enter information into the prompts before results are returned.

Tip – There is a limit to the number of rows a query can return. Sometimes there are prompts that allow the user to select a range. When the range selected is too large you may run into an error that indicates that not all of your results have been returned. In this case, select a smaller range in the prompts and try again.

Jake Abrams Software Consulting, Inc Oct.08http://sites.google.com/site/jascinc/Home

Page 9: Peoplesoft Row Level Security

Sort Data in ExcelAfter you have downloaded your query results to Excel it is very useful to ‘AutoFilter’ the data. This Excel functionality makes it very easy for a user to search through data on an Excel spreadsheet.

The first step is to freeze the top row so that you can always see the column headings. To freeze the top row, follow these steps:

Select the entire 3rd row. Go to the ‘Window’ menu and click the ‘Freeze Panes’ option.

Next, use the ‘AutoFilter’ functionality. To use 'AutoFilter' follow these steps:

Select the columns that you want to have the ability to filter. Go to the ‘Data’ menu. Select the ‘Filter’ option Select the ‘AutoFilter’ option.

Now you can easily sort the data using values from all of the columns you have highlighted.

Jake Abrams Software Consulting, Inc Oct.08http://sites.google.com/site/jascinc/Home

Page 10: Peoplesoft Row Level Security

Overview of Query ManagerThe PeopleSoft Query Manager tool enables report writers to easily extract data from the PeopleSoft system. Query Manager uses a graphical user interface to automatically build and run SQL (Structured Query Language) queries directly against the PeopleSoft database. SQL is a programming language used to extract data from relational database management systems. Query Manager generates SQL based on the input from the user. The user does not need to write the SQL themselves.

Query Manager makes it easy to build queries from multiple tables. The tool automatically creates SQL for complex table joins such as Effective Date, Row Level Security, and Parent-Child relationships. This is a gift to the query writer as it takes complex PeopleSoft specific SQL logic and makes it automatic for the query writer. However, Query Manager has limitations when a report writer needs to use complex SQL and SQL functions.

The purpose of this overview is to give query users some knowledge about the functionality and limitations of Query Manager. This knowledge will empower query users to better understand what to request when a query needs to be built or modified.

View Tables and Fields in a QueryA report writer builds a query by selecting fields from a table in the database. The Query Manager tool makes this process very easy by allowing the report writer to search through the tables in the database. The report writer can also view the fields in the table before selecting it to be part of the query. To view the tables and fields selected in a query the report writer will view the 'Query' page. This page will display every field from each table selected in the query. The report writer can also view the fields selected in the query on the 'Fields' page.

Query Page

Jake Abrams Software Consulting, Inc Oct.08http://sites.google.com/site/jascinc/Home

Page 11: Peoplesoft Row Level Security

Fields Page

The report writer can select fields from multiple tables by joining the tables together on their common 'key fields'. The Query Manager tool does a very good job of automatically joining tables together on their common key fields when a report writer selects multiple tables. In fact, PeopleSoft tables often have pre-defined table joins visible when a report writer views selected tables in the Query Manager tool.

However, Query Manager does not always join tables correctly. This will most often occur when the report writer is attempting to gather information from tables that are not closely related. For example, if a user is requesting data from both the HR and FIN systems together in one query the tables may have no key fields in common to create a join.

If a report writer selects data from multiple tables and does not join the tables together on their common 'key fields' the result will be a Cartesian join. A Cartesian join produces a row for every possible combination of the tables joined. This is otherwise known as a runaway query. A Cartesian join causes the results of the query to be the product of the total number of rows on each table not joined. For example, if a user selects data from Table A with 100 rows and Table B with 1000 rows, and Table A and Table B are not joined, the results will be 100,000 rows.

Avoiding Cartesian joins is one of the primary reasons why IT departments typically restrict access to the Query Manager tool. The other primary reason is that most PeopleSoft users do not know on which tables the data they are looking for exists.

Tip - A user of Query Manager typically does not have access to every table in the database. In most PeopleSoft installations a security team will decide which tables different groups of Query Manager users will have access to. For example, a user that creates reports for the Finance department may only have access to all the tables related to entering journal lines.

Jake Abrams Software Consulting, Inc Oct.08http://sites.google.com/site/jascinc/Home

Page 12: Peoplesoft Row Level Security

Edit a QueryThe main benefit of the Query Manager tool is that it enables a report writer to very easily build a query in a short amount of time using a graphical user interface. The report writer will typically not need to write any SQL when building a query using Query Manager.

Add/Delete Fields & TablesA report writer can very easily add or delete tables and/or fields in a query from the 'Query' page. As an example we have built a query to return all terms and their descriptions. See the below screenshot for examples of adding and deleting fields from this query. The query writer can also delete tables from a query on this page.

Jake Abrams Software Consulting, Inc Oct.08http://sites.google.com/site/jascinc/Home

Page 13: Peoplesoft Row Level Security

In order to add tables the report writer will use the 'Records' page to find the correct table needed for the query.

Add/Delete CriteriaA report writer can filter the results of a query by adding criteria on the 'Criteria' page. Adding criteria to a query limits the results returned by the report. Criteria will limit the rows returned in a report by only selecting rows where a field is restricted to the value(s) entered in the criteria.

For example, let's add some criteria to our example query. For this criterion we only want to return rows where the term is fall.

Jake Abrams Software Consulting, Inc Oct.08http://sites.google.com/site/jascinc/Home

Page 14: Peoplesoft Row Level Security

Now let's look at the results of the query. As you can see the rows returned are limited to only terms where the description is 'Fall'.

Jake Abrams Software Consulting, Inc Oct.08http://sites.google.com/site/jascinc/Home

Page 15: Peoplesoft Row Level Security

Add a PromptA report writer can enable the query user to filter the results at run-time by adding prompts to a query. A prompt is criteria for a field where the query user chooses the value(s) before running the query. As an example let's add a prompt on the term field for our example query.

Now let’s see what happens when we run this query with the newly created prompt.

Here are the results of the query.

Jake Abrams Software Consulting, Inc Oct.08http://sites.google.com/site/jascinc/Home

Page 16: Peoplesoft Row Level Security

A Brief SQL DiscussionSQL or Structured Query Language is the industry-standard language used for retrieving, adding and updating information in relational database management systems. The point of the Query Manager tool is to enable the report writer to easily create a query without having to write SQL. When a report writer creates a query, Query Manager automatically builds SQL based upon the fields, tables, prompts, criteria, etc. added to the query.

The SQL generated by Query Manager can be viewed on the 'View SQL' page.

Query SQL LimitationsSometimes a report writer will receive a request for a complex report where SQL functions will need to be used. Query Manager provides the 'Expressions' page as a way to add custom SQL to a query. However, the Expressions page is very limited in its ability to enter custom SQL functions. As a result, a query request with complex requirements will often have to be accomplished by other reporting tools where the report writer can write the SQL themselves.

Does a Query Manager User Need to Know SQL?It is not absolutely necessary for a Query Manager user to have a deep knowledge of SQL. PeopleSoft Query Manager will create many joins and complex PeopleSoft specific logic automatically when generating the SQL for a query. However, there is always the possibility that a Query Manager user might create a query where the table joins are incorrect. If this happens the best case scenario is that the user will have a query with incorrect results; but the worst case scenario is that the user has created a Cartesian join that will return millions of rows and cause the entire application to grind to a halt for all users.

Understanding relational database basics, SQL, and table joins is essential knowledge that a Query Manager user must have. This knowledge will enable the user to mostly avoid Cartesian joins and ensure that tables in a query are joined correctly. Even Query Manager users that have this knowledge can join tables incorrectly as PeopleSoft databases are complex with hundreds of tables and difficult built in logic.

As you can see, it is not essential that a Query Manager user know SQL, but it is very helpful. Many organizations only allow the IT department or specifically trained individuals’ access to Query Manager. However, user access to Query Manager varies widely from company to company.

Jake Abrams Software Consulting, Inc Oct.08http://sites.google.com/site/jascinc/Home

Page 17: Peoplesoft Row Level Security

Request a New Query or Changes to an Existing QueryThe IT team has created a form that PeopleSoft users can utilize to request a new query or request changes to an existing query. Information collected by this form includes:

Requester Name & Campus – Who are you and what campus do you work at?

Requester Email Address and Phone # - The IT team may have to contact the requester for more information.

Is this a request for a new query or a modification of an existing query?

If this is a request for the modification of an existing query, what is the query name?

Description of New Query or Modification to Existing Query - Please give a detailed description of the query you want built or changed. Include an overview of the data you are trying to gather for the report.

Fields Added to Query - Please enter the fields that you need added to the query. It is extremely helpful if you indicate the pages where the fields you are requesting exist. This gives the report writer the ability to quickly identify where in the database the requested data exists. To indicate the page, navigate to the page in PeopleSoft where the field you are looking to report on exists. While you are viewing this page click ‘CTRL’ and ‘J’ at the same time. A new page will display. You will be able to see the name of the page as well as other information.

Describe the Criteria Needed for the Query – Please give a detailed description of the filter criteria needed for the query.

Describe Any Prompts Needed for the Query – Please give a detailed description of any prompt fields needed for the query.

Reason for Request - Please enter the reason you are requesting the query. This will help the report writer determine if the data requested is correct. It will also enable the IT team to prioritize query requests.

Sometimes the user may not know on what pages the requested data exists. If this is the case the user must give a detailed description of the data needed in the query. It is likely that the report writer will contact the query requester if the requirements for the query are not clear.

Jake Abrams Software Consulting, Inc Oct.08http://sites.google.com/site/jascinc/Home