Top Banner
Exploiting PeopleSoft Query & Pivot Grids for Payroll & Absence Wednesday, 7 th June 2017 William Prescot
52

14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Jan 28, 2018

Download

Technology

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Exploiting PeopleSoft Query & Pivot Grids for Payroll & Absence

Wednesday, 7th June 2017

William Prescot

Page 2: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar

13/06/2017 2

The calendar shows availability of a manger’s team for the next two weeks.

Page 3: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar

Why use a pagelet?No need for a custom page. Automatically displays on a manager’s desktop. Adaptable & extensible. Configurable presentation.

13/06/2017 3

Page 4: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar

Adaptable & extensible; Adapt to your own reporting structure. Change the date range. Accommodate half-day absences. Use alternative work schedule. Retrieve training days.

13/06/2017 4

Page 5: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar

Configurable presentation; Change the colours. Differentiate between absence types. Include more employee data. Add header and / or footer.

13/06/2017 5

Page 6: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar

Building the team calendar in a pagelet involves; Employee selection Data retrieval Data transformation Presentation

13/06/2017 6

Page 7: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Employee selection

13/06/2017 7

PS Query uses %OperatorIDto identify the current user.

The user’s profile is linked to an employee ID.

Page 8: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Employee selection

13/06/2017 8

The employee occupies amanagement position.

Page 9: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Employee selection

13/06/2017 9

Employees in the manager’s team report to this position.

Page 10: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Employee selection

13/06/2017 10

Five employees currently report to the manager.

Page 11: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Data retrieval

Data is retrieved for;Work schedule assignment Calendar dates Scheduled hours Public holidays Absence events

Training enrolments could also be retrieved.

13/06/2017 11

Page 12: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Data retrieval

13/06/2017 12

Employees processed by Global Payroll or Absence Management belong to a pay group.

Each pay group has a default work schedule.

Page 13: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Data retrieval

13/06/2017 13

Employees without a work schedule assignment use the pay group default.

Employees can be assigned to a predefined work schedule, personal work schedule or the pay group default.

Page 14: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Data retrieval

13/06/2017 14

Select the current date and the next 13 from record TL_DATES_TBL (Date Attributes Table).

Page 15: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Data retrieval

13/06/2017 15

Work schedule assignment links to a work schedule definition which may be a personal one.

Page 16: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Data retrieval

13/06/2017 16

Each pay group has a default holiday schedule, which applies to all employees belonging to the pay group.

Page 17: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Data retrieval

13/06/2017 17

An absence event is recorded against an absence take element which links to an absence type.

Page 18: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Data transformation

13/06/2017 18

SQL view CC_CAL_HDR_VW (Department Calendar Header) retrieves the next 14 days as a number between 0 and 6.

SQL view CC_CAL_DTL_VW (Department Calendar Detail) retrieves the scheduled work hours, public holidays and absence events for each of the next 14 days.

Page 19: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Data transformation

13/06/2017 19

Query CC_DPT_CAL combines the two SQL views, selecting employees reporting to the current user and summarizes the 14 rows of daily availability into a single row for each employee with a number representing the availability;

• 0 for a day off.• 1 for a working day.• 2 for an absence event.• 3 for a public holiday.

The sequence number is used to position the header row at the top of the results.

Page 20: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Presentation

13/06/2017 20

A pagelet uses query CC_DPT_CAL as its data source.

Display option is Custom so that an XSL script can be used to change the presentation of the pagelet.

Page 21: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Presentation

13/06/2017 21

The query results can be displayed using one of the delivered XSL templates. The XML box shows the query results in XML format. It includes the following principle nodes;

• Queryproperties• Queryfields• Queryrows

Page 22: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Presentation

13/06/2017 22

A custom XSL script replaces the default one for a table.

The characteristics of each column in the table are defined.

For the header row (rownumber = 1 within the queryrows node), each of the 14 heading columns is transformed;

• 0 becomes ‘S’ for Sunday.• 1 becomes ‘M’ for Monday.• 2 becomes ‘T’ for Tuesday.• 3 becomes ‘ W’ for Wednesday.• 4 becomes ‘T’ for Thursday.• 5 becomes ‘F’ for Friday.• 6 becomes ‘S’ for Saturday.

Page 23: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Presentation

13/06/2017 23

For each row of employee availability (rownumber > 1 within the queryrows node);

• 0 for a day off is displayed as a grey square.• 1 for a working day is displayed as a green square.• 2 for an absence event is displayed as a red square.• 3 for a public holiday is displayed as a blue square.

After the last row has been displayed (position() = last()), a key is displayed, explaining the use of each colour.

Page 24: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Presentation

13/06/2017 24

Once the new XSL script is copied into the pagelet, the query results are transformed into a grid of coloured squares, representing employee availability for the next two weeks, with the day of the week at the top of each column and a key to the colours below the grid.

Page 25: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Pivot grid

13/06/2017 25

Displays a count of employees according to their availability over the next fortnight.

Hover over a column to display its meaning…

Page 26: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Pivot grid

Why use a pivot grid? Easier to configure than a pagelet. Displays on a fluid homepage. Provides built-in filters. Drills down to employee data. Supports related actions for selected employees.

13/06/2017 26

Page 27: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Pivot grid

13/06/2017 27

Click on a column to see who is working, off, absent or on holiday for a given day.

4 employees are working on May 26th.

Page 28: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Pivot grid

13/06/2017 28

Filter the display...

See what Mark Saylor is up to for the next 2 weeks

Do something interesting with Mark Saylor’s data…

Page 29: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Pivot grid SQL view

13/06/2017 29

SELECTWRK.EMPLID,WRK.CAL_DTE,CASE

WHEN WRK.SCH_HRS > 0 AND HOL.HOL_HRS > 0 THEN 'Bank Holiday'WHEN WRK.SCH_HRS > 0 AND ABS.ABS_TYP IS NOT NULL THEN 'Absent' WHEN WRK.SCH_HRS > 0 THEN 'Working'ELSE 'Off'

ENDFROM

Data retrieval is via the same SQL view as the pagelet except that availability is established during retrieval, as;

• Working• Off• Absent• Bank Holiday

Page 30: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Pivot grid query

13/06/2017 30

Query CC_DPT_PVT uses the same rules to establish the employees to select.

The query retrieves 14 rows for each employee, one for each day in the next fortnight, showing availability.

Page 31: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Configuring a team calendar – Pivot grid definition

13/06/2017 31

Availability description is added to the x-axis as a series so that a count of employees is shown for each day, according to the availability description.

Page 32: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Payee messages in a pivot grid

13/06/2017 32

Displays a count of payee messages, according to their severity, for all open pay groups.

Hover over a column to display its meaning…

Instantly see which pay groups still have error messages to resolve.

Page 33: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Payee messages in a pivot grid

Why use a pivot grid for payee messages? Displays as a summary on a fluid homepage. Use a bracket to classify messages;

Add messages to functional groups e.g. Tax & NIC. Define message priorities.

Configure relevant filters. Drill down to payee messages. Use related actions for speed and accuracy.

13/06/2017 33

Page 34: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Payee messages in a pivot grid

13/06/2017 34

Summary is displayed, along with available filters.

Page 35: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Payee messages in a pivot grid

13/06/2017 35

Use the filters to identify tax messages.

Page 36: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Payee messages in a pivot grid

13/06/2017 36

Jump directly to the relevant page with key fields already filled in…

Page 37: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Payee messages in a pivot grid – classification bracket

13/06/2017 37

Add relevant payee message numbers to the bracket, along with their attributes.

Messages not defined in the bracket are automatically classified as ‘Other’.

Page 38: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Payee messages in a pivot grid – data retrieval

13/06/2017 38

Query CC_PYE_MSG retrieves all payee messages and their attributes.

Classification and Priority are retrieved from the bracket.

Page 39: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Payee messages in a pivot grid – definition

13/06/2017 39

Severity is added as a series on the x-axis to show a count of payee messages by severity within each open pay group.

Page 40: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Formatting query output

Why use XSL to format query output? Alternative to BI Publisher reports. Embedded in the query definition so easy to distribute. Choice of output formats (XML, HTML, CSV, etc).Multiple XSL scripts for a given query.Works with Connected Query too (but not Composite Query).

13/06/2017 40

Page 41: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Formatting query output – HTML

13/06/2017 41

Query CC_DPT_CST lists employees in a department, along with their costs.

The query is run to HTML.

Page 42: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Formatting query output – XML

13/06/2017 42

Running the query to XML shows the hierarchical structure of the output.

<query> includes multiple <row> nodes, each of which includes data nodes such as <A.DEPTID> and <A.COMPRATE>.

Page 43: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Formatting query output – Defining XSL transformation

13/06/2017 43

Use the Transformationstab to add XSL scripts to a query.

The XSL script is written as XML.

In this case, a single script is attached to the query, providing a HTML report with subtotals.

Page 44: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Formatting query output – Previewing XSL transformation

13/06/2017 44

Press the Preview button to see the transformations carried out by the XSL script;1. A heading is added.2. Column labels are

emphasised.3. Duplicate

departments are suppressed.

4. Subtotals are shown for each department.

Page 45: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Formatting query output – Setting column widths

13/06/2017 45

A table is defined with 5 columns.

The <xsl:for-each> and </xsl:for-each> statements enclose a set of transformations to be applied to each <row> within the <query> node.

Page 46: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Formatting query output – Recording previous & next

13/06/2017 46

For each <row> within the <query> node, the department IDs for the preceding and following rows are ascertained so that duplicate department labels can be suppressed and subtotals can be printed after the individual employee costs for each department.

Page 47: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Formatting query output – Printing headings

13/06/2017 47

Report heading and column labels are printed before the first row of employee data.

Note the background colour for the column labels.

Page 48: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Formatting query output – Suppressing departments

13/06/2017 48

Each row of employee data is printed. If the department ID and label have already been printed for the preceding row then they are suppressed for the current row.

Note the formatting for the COMPRATE value.

Page 49: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Formatting query output – Adding subtotals

13/06/2017 49

If the department ID for the next row is different from the current department ID then a subtotal is printed for the current department.

Note the sum function used to add COMPRATE for the current row and all preceding rows with the same department ID.

Page 50: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Formatting query output – Scheduling the report

13/06/2017 50

Choose format XFORMand the required transformation script.

The required report is in the .HTML file.

Note that the file extension will be different if a different output type is selected when the script is defined.

Page 51: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

Formatting query output – Reviewing the final report

13/06/2017 51

Page 52: 14. Alex Lightstone & Bill Prescot - Exploiting PeopleSoft Query & Pivot Grids

William Prescot

[email protected]