Gain hands on experience running advanced reports with commonly used custom expressions, and see how fixed criteria can be used to place limitations on reports.
3. MC University
Custom Expressions Overview
Calculate Increase in Cost Example
Convert Date Field Example
Custom Expressions Defined
4. MC University
Custom Expressions are used to modify
format of a field or perform calculations
Examples of Custom Expression uses:
• Remove time stamp from a date field
• Change display case (e.g. all UPPERCASE)
• Calculate elapsed time (e.g. days open or time
taken to respond)
Custom Expressions Overview
5. MC University
Steps to create Custom Expressions:
• Determine which field to base expression on
• Select field to use as placeholder
• Adjust label for Report column
• Select Custom Expression? indicator
• Create and enter Custom Expression
Custom Expressions Overview (cont’d)
6. MC University
Custom Expressions are not case
sensitive
Common Expressions include:
• DATEDIFF
• GETDATE()
• CONVERT
Custom Expressions Overview (cont’d)
7. MC University
Custom Expression Examples:
Custom Expressions Overview (cont’d)
Description Expression
Upper Case a Field Value UPPER(WO.Reason)
Days Work Order Open
since Requested Date
DATEDIFF(day,WO.Reque
sted,GETDATE())
Hours to Issue Work Order DATEDIFF(hour,WO.Reque
sted,WO.Issued)
Date Returned without Time
Stamp
LEFT(WO.Requested,12)
Adding two field values
together (e.g., Work Order
Labor Cost + Work Order
Parts Cost)
WO.CostLaborActual+WO.
CostPartActual
8. MC University
In this example an Inventory report will
use a Custom Expression to calculate
the costs of re-ordering with a 10%
increase in cost
Calculate Increase in Cost: Example
9. MC University
Determine field name to base
expression on and select placeholder
field:
Calculate Increase in Cost: Example (cont’d)
10. MC University
Enter Custom Label for placeholder field
and appropriate Field Type:
Calculate Increase in Cost: Example (cont’d)
11. MC University
Set Custom Expression control to Yes
and enter expression into Custom
Expression Box:
Calculate Increase in Cost: Example (cont’d)
12. MC University
Result on Report will show forecasted
price:
Calculate Increase in Cost: Example (cont’d)
13. MC University
In this example an Open Work Order
List report will be used to convert the
WO.Requested date and time format to
only show the date
Convert Date Field: Example
14. MC University
Determine field name to base
expression on and appropriate field
type:
Convert Date Field: Example (cont’d)
15. MC University
Set Custom Expression control to Yes
and enter expression into Custom
Expression Box:
Convert Date Field: Example (cont’d)
16. MC University
Result on report will show only the
WO.Requested date (no time):
Convert Date Field: Example (cont’d)
17. MC University
Now let’s practice creating a test Report
and adding a Custom expression to
show how many days a Work Order has
been open since the Requested Date!
Building Custom Expressions: Hands-On
18. MC University
Access the Reporter and copy the Open
Work Order List
Enter a unique Report Name
• Example: “Open Work Order List with
Custom Expression – Initials – Date”
Building Custom Expressions: Hands-On (cont’d)
19. MC University
Run your newly copied Report and
navigate to the Report Setup
Find the [WO] Requested field in the
Available and add it to the Display fields
Building Custom Expressions: Hands-On (cont’d)
20. MC University
Add [WO] UDF Field 10 as the
placeholder field
Select [WO] UDF Field 10 in the Display
fields list and click Edit
Building Custom Expressions: Hands-On (cont’d)
21. MC University
Enter Days Open into the Field Label
(Custom) prompt
Select Numeric from the Field Type
(Custom) dropdown
Building Custom Expressions: Hands-On (cont’d)
22. MC University
Click the Yes control in the Custom
Expression? Field prompt
Enter the following expression:
• DATEDIFF(DAY,WO.REQUESTED,GETDATE())
Building Custom Expressions: Hands-On (cont’d)
23. MC University
Apply all changes
Report will appear similar to the
following:
Building Custom Expressions: Hands-On (cont’d)
24. MC University
You have now succesfully completed
creating a test Report and adding a
Custom Expression!
Building Custom Expressions: Hands-On (cont’d)
25. MC University
Fixed Criteria Overview
Work Order Completion Date Example
Common Fixed Criteria
Fixed Criteria Defined
26. MC University
Fixed Criteria uses:
• Criteria can be hidden from end users
• Meaningful filters are placed on data
• Complex data relationships can be
specified
Fixed Criteria Overview
27. MC University
Defined Fixed Criteria appears at top of
Report Criteria Dialog:
Fixed Criteria Overview (cont’d)
28. MC University
Additional Fixed Criteria added from
Advanced tab of Report Setup
• Added to Where (SQL) field
Fixed Criteria Overview (cont’d)
29. MC University
Description Expression
On an open work order report, show only
work orders that are overdue.
WO.IsOpen=1 and
WO.TargetDate<Getdate()
On a closed work order report, show only
work orders that took more than 10 days to
complete.
WO.IsOpen=0 and
DATEDIFF(DAY,WO.Requested,WO.
Complete)>10
On a closed work order report, show all work
orders that have no value in the “Problem”
field.
WO.IsOpen=0 and ProblemID is null
On a closed work order labor report, show
only “actual” labor hours (exclude any
estimated labor hours). Actual labor records
are recorded with a WOLabor.RecordType of
“2”.
WO.IsOpen=0 and
WOLabor.RecordType=2
Common Fixed Criteria
30. MC University
In this example a Closed Work Order
List report is used to show Work Orders
that have taken greater than 10 days to
complete
Work Order Completion Date: Example
31. MC University
Logical field(s) are added to Display
for clarity of data presented:
Work Order Completion Date: Example (cont’d)
32. MC University
Expression is entered into the Where
(SQL) field:
Work Order Completion Date: Example (cont’d)
33. MC University
Requested and Complete fields help
double-check report data once report
is run:
Work Order Completion Date: Example (cont’d)
34. MC University
Now let’s practice utilizing Fixed Criteria
to create an Open AND Closed Work
Order Report!
Utilizing Fixed Criteria: Hands-On
35. MC University
Select the Open Work Order List and
copy this base report
Enter a unique Report Name
• Example: “Open AND Closed Work Order
List using Fixed Criteria – Initials – Date”
Utilizing Fixed Criteria: Hands-On (cont’d)
36. MC University
Navigate to the Report Setup
Select the Advanced tab SQL
Structure sub-tab
Utilizing Fixed Criteria: Hands-On (cont’d)
38. MC University
Apply changes
Both open and closed Work Orders will
appear on the report:
Utilizing Fixed Criteria: Hands-On (cont’d)
39. MC University
You have now succesfully completed
creating an Open and Closed Work
Order Report using Fixed Criteria!
Utilizing Fixed Criteria: Hands-On (cont’d)