Defining custom criteria
Use the Custom Criteria function to generate reports using criteria other than what is already provided in the Sage HRMS standard selection criteria.
Note: When you use any custom criteria, Sage HRMS disables all other selection criteria. To clear your custom criteria selection, select the blank option from the Custom Criteria list on the Standard Criteria tab.
The Custom Criteria Table
When you create expressions that define specific criteria for selecting employees, you can have Sage HRMS store these expressions in the Criteria Code table. When you set up options for your reports, you can choose a criteria code from (or add a new one to) the Criteria Code table. Sage HRMS then generates the report according to the expression set up for the criteria code you selected.
Tip: If the expression you want to create is one you will be using more than once, add it to your Criteria Code tables so it will be available for you to select any time you need it.
- On the Standard Criteria tab, select in the list.
-
The Custom Criteria Table page lists the criteria codes from your Criteria Code Table. Highlight the code you want to use.
Note: If you did not define any criteria codes, only the Add New Code selection appears in the Criteria Table window.
-
Click
.The expression appears for Standard Criteria tab.
on the
- On the Standard Criteria tab, select in the list.
- On the Custom Criteria Table page, click and then click .
- On the (New) Criteria Table page, enter a description for your criteria, and then click .
-
In the Expression Builder window, create the expression.
For example, to generate a report for only seasonal workers, select the P_SEASONAL field from the Pe (Employee Personnel) database table and set it equal to .
-
When you complete the expression, click
.The expression displays for Standard Criteria tab.
on theIn the example, Sage HRMS uses the expression to generate a report that only includes seasonal employees.
The Custom Criteria Builder
You can use the Sage HRMS Criteria Builder to build expressions for your selection criteria and save them to your Criteria Code table.
Note: With the Criteria Builder, you can only create an expression with fields from the Employee Personnel (HRPERSNL) database. If you need to build an expression with fields from a database other than HRPERSNL, you must use the Visual FoxPro Expression Builder.
- On the Standard Criteria tab, select in the list.
-
On the Criteria Builder page, build your expression:
- Make a selection in the list.
- In the list, select a relationship expression.
- For , type the value that you want to select for that field.
Example: To limit the selection to employees whose Job Title is Production Manager, select for , select for , and type Production Managers for .
-
If you need to add another criterion to the expression:
- Click the button. The first part of the expression appears in the window.
- Repeat step 2.
Example: To also limit the selection to Production Managers who started their job on or after 01/01/17, select for , select for , and type 01/01/17 for .
Note: If you want to delete all the criteria you defined and start over, click . If you want to delete one criterion at a time (from the last to the first), click .
-
When you finish defining the expression, click
.The page now shows the complete expression.
-
To save the expression to your Criteria Table:
- Click the button.
- In the Criteria Table window, type a description for your new expression.
- Click .
-
To save and select the expression, click
to return to the report page.The expression displays for Standard Criteria tab.
on the
The Visual FoxPro Expression Builder
If you need to build expressions with a field that is not in the Employee Personnel (HRPERSNL) database, use the Visual FoxPro Expression Builder.
Tip: If you only need to use fields from the Employee Personnel database (HRPERSNL) in your expression, consider using the Criteria Builder instead.
- On the Standard Criteria tab, select in the list.
-
In the Expression Builder window, build your expression:
- In the list, select the database table to use.
-
In the
list (which lists the fields from the database table you selected in step 2a), double-click the field to use.The database table alias and field appear in the Expression area near the top of the window.
-
In the Logical list, select the operator that you want to use in the expression.
The operator is added to the Expression area.
-
Click to place your cursor at the end of the expression, and then type a space and the comparison value.
Note: Different types of values must be entered in different formats:
- Character values must be enclosed with quotation marks: 'value' or "value"
- Date values must be entered as numbers and enclosed with {braces}: {date}
- Logical values (such as T or F for True or False) must be enclosed in periods: .T.
- Numeric values are entered directly: 235.12
Example: To limit the selection to active employees, select the table (the alias for the Employee Personnel database file), for the field, in the list, and type 'A'. Your expression would look like this:
Pe.p_active = 'A' -
If you need to add another criterion to the expression:
- Type a space at the end of the expression in the Expression area.
-
In the Logical list, select the operator, such as .
The operator is added to the Expression area.
- Repeat step 2 to add the second criteria.
Example: To also limit the selection to employees in the Sales department (organizational level 1), select the table, for the field, in the list, and type 'SALES'. Your expression would now look like this:
Pe.p_active = 'A' AND Pe.p_level1 = 'SALES' -
Click
.Tip: You can click Verify to make sure you used the correct structure for your expression. For example, there is an equal sign, it will confirm that there is a value after the equal sign. When you save your expression and return to the report or process to use the expression, Sage HRMS checks your expression again. If it is an illogical expression, a message displays and indicates what is wrong; return to the Expression Builder and fix the error.
The expression appears for Standard Criteria tab. Your expression is then available from the Custom Criteria list on the Standard Criteria tab when you generate reports within the selected report category. protesters
on the