Expressions and Wes Functions Overview
- Expressions are calculations that PeopleSoft Query performs as part of a query.
- They are created on the Expressions page.
- Use them when you must calculate a value that PeopleSoft Query does not provide by default.
- An expression can be used like a field. If you use an expression as a field, the expression can be used like any other field in a query. When you preview the query, the expression name appears as a column heading in the query. When selected for output, you can change its column heading or sort it. Normally, data that is the result of a calculation is produced when the query is run in real time.
- You use expressions to display a field value differently from the way you store the value.
A Wes Function is a method created by the Wesleyan ITS staff that enables the PeopleSoft user to exploit the benefit that Expressions can lend to a query. It is pre-written text created specifically for inclusion in Query Expressions for Wesleyan Users.
The expressions used in these Demonstrations are based on Functions created by the Wesleyan ITS staff to facilitate common query requests. These Functions usually have the word “GET” as part of the name (as in WES_GET_ABC); however, there are some Wesleyan Functions that do not. Click here to see a chart listing Wes Functions.
Building an Expression with a Wes Function
In this example a query uses the records PERS_DATA_SA_VW and ADDRESSES. The expression to be added to the query will show the Wesleyan Class Year for each student row returned.
SQL EXAMPLE with FUNCTION and Formatting of Date
When using dates in a query, you have the opportunity to have the output formatted in a variety of ways. This documentation supplies some examples for dates as well as name parts. Also take a look at the list of Expressions that supplies other samples. This article displays various date formats that you may want to use in an Expression. Also demonstrated are the use of concatenation with a date and the use of the WES_GET_NAME_PARTS Wes Function. Displayed are the output and the associated SQL.