An expression is some form of operation involving numbers, character strings, or dates and times.
Expressions can be used in a field or criteria.
Many SQL functions can be used in PS Query expressions.
You cannot use some SQL functions, such as 'if' or 'where' in Expressions.
Sometimes Expressions need tweaking.
Step by Step for Creating Expressions
Expression is created in the "Expression" page. Click the "Add Expression" button to create a new expression
Select Expression Type
Set the length of the new field
Type your expression in the box for "Expression Text."
After creating an expression, click "Use as Field" if you want the new field to be used in the query. If you want to use the expression as a criteria, click the funnel icon. The criteria will be added to the Having tab if the field is an aggregated field. Please see the Having page for more information. Otherwise, the criteria will be under Criteria tab.
limiting results to specific values based on criteria
returning different values or splitting one field into multiple values
Structure of case statement:
Example - case statement
/*+Institution short desc*/
CASE
WHEN A.INSTITUTION = 'UMS01' THEN 'UMA'
WHEN A.INSTITUTION = 'UMS02' THEN 'UMF'
WHEN A.INSTITUTION = 'UMS03' THEN 'UMFK'
WHEN A.INSTITUTION = 'UMS04' THEN 'UMM'
WHEN A.INSTITUTION = 'UMS05' THEN 'UM'
WHEN A.INSTITUTION = 'UMS06' THEN 'USM'
WHEN A.INSTITUTION = 'UMS07' THEN 'UMPI'
ELSE 'Check'
END
IMPORTANT NOTE When you use AddField function in the edit expression, the application will insert the field's alias, A. You need to either delete the "A." characters or enter the field freeform to make the field operate as a date field and not a character field.