Question
How do I display an employee policy name in reports?
Answer
Background
When creating custom timesheet summary or details reports, you might need to display an employee's policy name. To access the employee profile policy assignment and display it in reports requires a SQL expression.
Example Report
In this example, create an Employee Summary Report:
- Navigate to the Reports tab
- Scroll down the Timesheet Reports templates box.
- To create a custom Employee Hours Summary report, click on the Plus (+) button on report template row called: "Employee Hours - Employee hours summary"
- This action will create a new custom version of this report and open up the report edit page and leave you in edit mode.
- To add a report column that displays the employee policy name, you will need to create a SQL expression field.
- Next to the Report Columns box, click plus to add a new field.
- A picklist box will display
- Scroll down to the bottom of the list to <<Add SQL Expression>> and click on that list item
- A SQL Expression dialog will open
- Copy and paste the following sql into this dialog:
SELECT pp.name FROM t_policy AS pp WHERE pp.id=t_user.policyid
- Make sure the Data Type is set to "Text"
- Click OK to save
- One important last step: when in report edit mode, scroll down to the bottom of the report edit page and click on Options
- In the Option dialog, in the edit box "SQL "Group By" Expression:" add a comma (,) to the right of the text of existing grouped by expressions.
- In the case of this report, the SQL "Group By" Expression: text should look like this:
t_user.fullname,t_user.policyid - click OK to save and close the SQL "Group By" Expression: dialog
- Then click OK to save the report.
- Click on the report name to run the report, and you should see the policy name value display with the employee hours summary data:
Here is a sample of a simple report page for one employee:
These These SQL expressions and Group By expressions can be applied to any hours or expense summary or details reports.
Comments
0 comments
Please sign in to leave a comment.