Assignment+11 Reports&+Dashboards
Assignment+11 Reports&+Dashboards
First we'll start by adding the Reports tab to the set of default tabs that are displayed for every
Recruiting app user. To do so, we need to revisit the Recruiting app that we created way back
in Building a Simple App
1. Click Your
Setup ➤ Create
Name ➤ Apps
➤ Setup ➤ Create ➤ Apps.
2. Click Edit next to the Recruiting app.
3. In the Choose the Tabs section, add Reports to the Selected Tabs list.
4. Optionally, select Overwrite users' personal custom app
customizations.
If you choose this option, the Reports tab is automatically added to the tab bar by
default for all users. If you've already deployed your app and you'd rather not overwrite
existing users' changes, leave this option unchecked. Users can manually add the
Reports tab to their personal tab bar by clicking the + tab.
5. Click Save.
Perfect! Now let's visit the Reports tab to perform our next task: creating a folder for Recruiting
reports.
Because every organization already comes with over fifty standard reports and around a dozen
report categories, it's important to create a new category whenever you're defining a new set
of reports. It's an easy way of making sure that your users can always find the reports they need.
To define a new report category, we simply have to define a new report folder:
1. In the Reports tab, click Create New Folder next to the Folder drop-down list.
2. In the Report Folder Label field, enter Recruiting Reports.The Folder
Unique Name field autopopulates with Recruiting_Reports. Leave this default
value.
3. In the Public Folder Access drop-down list, choose Read Only.
By choosing Read Only for this folder, only administrator users can modify the reports the
folder contains, or save new reports to it. However, because all users can create their own
reports, this won't hinder your users from modifying a report that we create and saving it to a
personal folder of their own.
Because this report is going to use so many different reporting features, we'll break down the
procedure into three parts:
1. Creating a summary report
2. Adding columns and filters
3. Adding a chart
1. On the Reports tab, click the Create New Custom Report button.
The first step in creating a report is choosing the right report type. A report type defines the
set of records and fields available to a report based on the relationships between a primary
object and its related objects. Reports display only records that meet the criteria defined in the
report type. Your administrators may have set up custom report types for you, or you can select
from the available standard report types.
To help with navigation in this screen, all objects and relationships are grouped in categories
like Accounts & Contacts or Customer Support Reports. The custom objects and relationships
that we built for our Recruiting app can be found in Other Reports.
Note: The Other Reports category contains all reports based on just custom objects.
If you've built a custom object that's related to a standard object, such as Account or
Contact, you'll also be able to report on your custom object in the standard object's
category.
2. From the Create New Report page, select the Other Reports category.
Objects that have a many-to-one relationship with another object, like Job Applications and
Positions, can either be selected on their own or in the context of their relationship with the
other object. For example, if we select Job Applications with Position, our report will count
job application records, but can filter, group, or display fields from the related position records
as well. This will come in handy a little later when we build reports that count job application
records. But because we need to count position records in our report and positions aren't on
the many side of a relationship, we'll stick with a standalone positions report for now.
3. Select Positions.
4. Click Create.
Now that we've chosen the report type, we can customize the report. Note that we can't go
back and change the report type. To do that, you have to start with a whole new report. The
report builder's Preview pane displays a limited set of data; we can also run the report at any
time to see if we have the results we're looking for. For example, let's see what a baseline
positions report looks like without any customizations.
Note: The View drop-down list defaults to My Positions. If you are logged in as a
user who does not own any positions, select All Positions from the View drop-down
list before you click Run Report. The report will then display all the positions to which
you have access.
As you can see, without specifying any details, we already have a list of position records with
a Grand Total at the bottom. This is the equivalent of what we might see if we were creating
a tabular report without additional columns. Now let's take this basic report to the next level.
When creating a new report, we first need to choose the format of the report that we want to
create. The default is tabular. Because we want to group rows of open positions by functional
area, we'll create a summary report.
8. Find Functional Area in the Fields pane and drag it to the grouping drop zone
in the Preview pane. When you have lots of fields, using Quick Find is usually fastest.
Figure 91: Adding a Grouping for a Report
We're closer now! Our report still only lists position titles, but now they're grouped by the
functional areas to which they belong. Also, each grouping has a record count subtotal in
parentheses. These counts will be the basis of the pie chart that we'll add later.
In addition to Position Title, which is already selected by default, we also want to display
the Hiring Manager, Location, and Status fields for each record.
• Hiring Manager
• Location
• Status
You can also double-click fields to add them to end of the report.
We're even closer to our goal. However, the Status field shows us that the report includes
some position records that have already been filled. Since we only want to view the new and
open ones, we need to set some filters.
Now, let's set up the filters that should be applied to this report. Filters define the set of records
to be included in the report; for example, you can include only records created this month or
only records belong to a certain user. With standard filters, you can quickly filter by record
owner or date field. With custom filters, you can filter on any field in the report. Because we
want to view open positions across the entire organization and not just positions that we own
(by default, all custom reports include “My” records only), we need to set two filters:
Tip: Notice that whenever you choose a checkbox field or a picklist field, like Status,
in your filter, a lookup icon ( ) shows up next to the filter row. Click the icon to view
valid values for that field and quickly insert the ones by which you want to filter.
Using this filter of Status equals New Position, Pending Approval, Open
- Approved means that our report will include only those position records with one of these
three statuses. Note that the comma between the three Status values is treated as an OR
function, so this one filter is the same as using these three filters:
The chart builder automatically knows that we want the values to be the record count, and the
wedges to be the different functional areas. That's because chart values correlate to a report's
summary fields, and pie chart wedges correlate to a report's groupings. Had we grouped our
data with an additional column (like Position Owner), we would have had a choice of which
field values to display in the wedges.
Now let's finish up our chart and generate our final report:
2. Click OK.
Figure 94: The Final “Open Positions by Functional Area” Summary Report
Terrific! Because our report meets all of our criteria, let's save it to the Recruiting Reports
folder.
Now if we view the Recruiting Reports folder, we can see our new summary report. Next, we'll
make a matrix report that takes advantage of some of the more advanced reporting features.
Because this report is going to use so many different reporting features, we'll break down the
procedure into four parts:
1. Creating a matrix report
2. Adding custom summary fields
3. Adding columns and filters
4. Adding a chart and conditional highlighting
Because we want to directly compare individual recruiter performance for positions that do
and do not require travel, we'll use a matrix report. That way we can group the rows of positions
by recruiter, and columns of positions by whether or not they require travel.
Now let's group by both rows and columns. Notice the two sets of drop zones for matrix reports.
5. From the Fields pane, drag Position: Owner Name to the row grouping drop
zone.
6. Now, drag Travel Required to the column grouping drop zone.
Our report now breaks out the possible values for the Travel Required field in the columns
dimension. Recruiters are also broken out in the row dimension, but because all custom reports
query just the report creator's data by default (that is, “My” records only), only one recruiter is
listed in the report so far. Let's keep going.
For example, it doesn't make sense to sum the values of the Days Open column—the resulting
total wouldn't provide much value. However, if we calculate the average for Days Open, we'd
know roughly how long positions stay open.
For our report, we need to include three different types of summaries: record count, average
days open, and a formula that calculates the percentage of records requiring travel. While the
first two are standard summary fields, the third will require a visit to the Custom Summary
Formula editor. Let's start with the first two. By default, the report already adds Record
Count, so let's add the average for the number of days a position stays open.
1. Find the Days Open field and drop it just above the Record Count row in the
Preview pane.
2. In the Summarize dialog, select Average.
Now, let's create that formula to calculate the percentage of records requiring travel.
3. Double-click Add Formula. You'll see the Custom Summary Formula editor.
The formula editor lets us define a new formula based on the summarizable fields in the report.
In our case, we want to include a summary that shows the percentage of position records that
require travel in any given segment. To make this calculation we need to divide the sum of
records that require travel by the sum of all records:
Now, let's write our formula. Similar to other formula editors in the platform, this provides
tools to make make it easier.
9. In the Formula section, click Summary Fields and select Travel Required, then
select Sum.
The formula editor displays the following API representation of those values:
Position__c.Travel_Required__c:SUM
Position__c.Travel_Required__c:SUM / RowCount
We can quickly verify that the formula is correct by checking its syntax before saving.
Note: Before you can add fields to a matrix report, make sure to select Show ➤
Details. If details aren't shown, you can only add summary fields.
Days Open and Travel Required should already be part of your report.
For our report, we want to define three filters: one to include all positions, one to include only
those positions created in the last year, and one to include those with a Status of Open -
Approved or Closed - Filled.
Notice that all other date fields defined on the Position object are also available under Columns,
including Close Date, Hire By, and Open Date.
4. In the Duration drop-down list, choose Current and Previous CY (meaning this
and last calendar year). The start and end dates are populated automatically.
7. Click OK.
All three of our summary fields are available to highlight, but we just want to emphasize one:
Average Days Open. That's because we want to highlight which recruiters are closing
positions in less than 30 days, less than 60 days, or more than 60 days.
10. Click the Show drop-down list and select Conditional Highlighting.
11. In the first row, set the Select Field drop-down list to Average Days Open.
12. Set the Low Color to a shade of green using the color picker.
13. In the Low Breakpoint field, enter 30.
14. Keep the Mid Color the default shade of yellow.
15. In the High Breakpoint field, enter 60.
16. Set the High Color to a shade of red.
17. Click OK.
18. Click Run Report.
Our report succeeds in showing how well our recruiters fill positions and provides at-a-glance
insight into how long, on average, positions stay open. Conditional highlighting shows which
positions are taking longer to fill—generally those requiring travel. Let's quickly save this report
before moving on.
Introducing Dashboards
A dashboard shows data from source reports as visual components, which can be charts, gauges,
tables, metrics, or Visualforce pages. They provide a snapshot of key metrics and performance
indicators for your organization. Each dashboard can have up to 20 components. Users can
view any dashboard available in a public folder in their organizaton, such as Company
Dashboards, and can select a favorite, whose first three components display on the Home tab.
To put it mildly, users love the summarized views they get with dashboards, and no good
Force.com app is complete without at least one.
Figure 97: A Sample Recruiting Dashboard
Tip: Want to click along with our dashboard instructions but don't want to spend
your time creating all these new reports? Just create the Positions Open Longer Than
90 Days report in the first row. However, if you're interested in recreating the sample
dashboard displayed here, you'll need to create the other four as well.
Table 40: Additional Recruiting Report Specifications
Recruiter Status What does the job Job Format: Matrix Report
application pipeline look Applications
Subtotal Rows by: Position:
like for each recruiter and with Position
Owner Name and then by
open position?
Position: Position Title
1. Click the Dashboards tab and click Go to Dashboard List near the top of the screen.
Note: Unlike other tabs, opening the Dashboards tab always displays the last dashboard
that you viewed. If you've never visited the tab before, it displays a sample dashboard
that comes by default with every organization.
Each dashboard has a running user, whose security settings determine which data to display
in a dashboard. All users with access to the folder see the same data, regardless of their own
personal security settings.
The running user's security settings only apply to the dashboard view. Once a user drills down
into a source report or detail page off the dashboard, the user will view the data based on his
or her normal security settings.
For example, suppose a system administrator with the “Modify All Data” permission is the
running user for our recruiting dashboard. In this case, every recruiting-related record is counted
in all of the report totals on our dashboard, including users who'd normally be restricted from
viewing certain records (like those assigned to the Standard Employee profile). Although those
users would be able to see the summary data for all records in the dashboard, if they navigated
to the source reports, they'd see just the records they have access to.
When you're designing a dashboard, keep the dashboard's audience in mind. Ask whether any
of the information is sensitive and how much you want them to see. If you do give a user access
to dashboards that include more data than he or she normally has permission to view, be sure
to communicate that they might see different values when they click through the dashboard
to view the associated reports. And if you need to restrict a dashboard from certain users, just
save it to a restricted-access folder.
Did you know you can set up a dynamic dashboard that shows users data according to their
own security settings?
Say you want to show the same set of dashboard components to different sets of users,
each with a different level of visibility. You'd potentially have to set up dozens of
dashboards with the right running user for each, and store them in separate folders. With
dynamic dashboards, administrators can accomplish the same thing without having to
create and maintain all those extra dashboards and folders. A single dynamic dashboard
can display a standard set of metrics across all levels of your organization.
To find out more, see “Dynamic Dashboards Overview” in the Salesforce.com online
help.
For our recruiting dashboard, the data that we'll be showing in the dashboard isn't particularly
sensitive. Consequently, we'll choose a system administrator as the running user, and save the
dashboard to a public folder.
9. In the View dashboard as field in the upper right of the screen, enter the name
of a user with system administrator privileges. This sets the running user for the
dashboard.
We now have an empty dashboard that's ready to be filled with components.
• Charts—Displays a bar, column, line, pie, donut, or funnel chart—or any chart contained
in a report.
• Tables—Displays a table that contains values and totals from columns in the report.
• Metrics—Displays the grand total from a report, along with a label that you enter.
• Gauges—Shows the grand total of a report as a point on a “fuel-tank” type of scale.
• Visualforce Pages—Displays any Visualforce dashboard component in your organization.
1. Drag a pie chart component onto the left column of your dashboard.
2. Click “Edit Title” and enter Open Positions by Functional Area.
3. Click the Data Sources tab and find and select the Open Positions by Functional
Area report.
4. Drag the report and drop it onto the pie chart component.
Ta-da! We now have a pie chart in our dashboard! If a user clicks on the chart, they're taken
to the report from which the chart was generated.
Now, let's change how our gauge looks. Just like the conditional highlighting in our matrix
report, this gauge can display different colors depending on the total count of positions that
have been open too long. We want a green color if there are fewer than two positions, yellow
if there are between two and five, and red if the value is over five.
7. Click OK.
Perfect! Our recruiting dashboard now contains two components.
Just like its underlying source report, we can add conditional highlighting to our table
component to highlight recruiter performance levels. We want a green color if the recruiter
needs fewer than 45 days, yellow if he or she needs between 45 and 75 days, and red if the
value is over 75.
7. Click OK.
1. Drag a metric component onto the right column of your dashboard and drop it below
the table component we just created.
2. Click the Data Sources tab and find and select the Avg Days to Hire With and
Without Travel report.
3. Drag the report and drop it onto the gauge component.
Because metric components consist of a single value, they don't need a title. Instead, we give
them a label much like any other field that you see in the platform:
Note: Did you notice that we're using the same report that we used for our table?
This metric is just another visualization of the data in that report.
7. Click OK.
We've now got a simple, four-component dashboard for our Recruiting app! Finally, let's save
our dashboard:
8. Click Close, then click Save & Close. You can also click Save if you want to update
the title or description, or change the folder.
Figure 100: Four Components on the Recruiting Dashboard
If you click the Home tab, you can add the dashboard's first row to your home page. Be sure
to add the dashboard section to your home page layout and then follow these steps:
1. On the Home tab, click Customize Page in the upper right corner of the Dashboard
component.
2. Select Recruiting Dashboard from the Dashboard Snapshot drop-down
list.
3. Click Save.
And because we saved the dashboard in a public folder, any user can add it to his or her Home
tab, too.
As you can see, once we created the reports for our Recruiting app, adding them to a dashboard
was a piece of cake. It's so easy, that we'll leave the remainder of the components as an exercise
for you to try on your own—
270
Refreshing Dashboards
Dashboards reflect a snapshot of your data at a specific time. On the Home tab, that time is
indicated in the upper left corner on the Dashboard component; on the Dashboard tab, it's
indicated in the upper right corner. You can refresh your dashboards on either tab by clicking
the Refresh button.
If you are using Enterprise or Unlimited Edition, you can schedule dashboards to refresh
automatically at specific times, and upon completion, receive an email notification that includes
the refreshed dashboard.
Scheduling a dashboard refresh is easy. On the dashboards tab, simply click the down arrow
on the Refresh button and select Schedule Refresh..., then, indicate who should receive the
notification email and the time you want the refresh to occur.
Custom report types define the criteria from which your users can run and create reports. When
you create a report type, you specify the objects, relationships, and fields that users can select
for their reports.
How are custom report types useful in our Recruiting app? Well, our recruiters will appreciate
it if we give them an easy way to scan for positions to which candidates have applied. In addition,
the recruiters will probably want to see which of those job applications have reviews. That way,
they'll know if any positions are on the verge of closing.
1. Click Your
Setup Name ➤ Setup
➤ Create ➤➤ Create
Report ➤ Report Types.
Types
2. If you see an introductory splash page, just click Continue.
3. Click New Custom Report Type.
The custom report type that we're creating will include data from three different objects:
Position, Job Application, and Review. Positions will be the focus of the recruiters, though,
so let's make Position the primary object in this report type.
5. In the Report Type Label field, enter Positions with Reviewed Job
Applications.
6. In the Report Type Name field, enter Positions_with_Reviewed_Job
Applications if it is not there already.
7. In the Description field, enter Which positions have job applications
that have been reviewed?
8. In the Store in Category drop-down list, select Other Reports.
When creating a report type, set its status to In Development if you want to test it before
making it available to all your users; however, the report type we're creating does not require
much testing, so let's deploy it:
9. Select Deployed.
10. Click Next.
The platform uses a graphical hierarchy and set diagrams (also called Venn diagrams) to let us
easily specify which related records from other objects we want to include in the report results.
11. Click the white box under box A (Positions). Box B appears.
12. On box B, select Job Applications from the drop-down list, and leave Each "A"
record must have at least one related "B" record selected.
Figure 101: Report Type Hierarchy and Set Diagram for Positions and Job Applications
By leaving this option selected, we've indicated that we want this report type to only include
position records for which there are job applications. Notice how the set diagrams on the right
change to reflect our selection.
13. Click the white box under box B ( Job Applications). Box C appears.
14. On box C, select Reviews from the drop-down list, and leave Each "B" record
must have at least one related "C" record selected.
Figure 102: Report Type Hierarchy and Set Diagram for Positions, Job Applications,
and Reviews
We've further narrowed the scope of our report to only include job applications that have
reviews.
This report type incorporates three objects (Position, Job Application, and Review), each
containing many fields. A user creating a report using this custom report type will likely be
overwhelmed by all of those fields, so let's remove the ones they won't need, and move the
important ones to the top. We can also specify which ones are selected by default.
16. On the Custom Report Type detail page, scroll down to the Fields Available for
Reports related list and click Edit Layout.
Important: If a field isn't in a section, it won't be available to users when they generate
reports from this report type.
17. Create a new section called Position, Job Application, and Review
Fields.
18. In the Positions section, change the label of the following fields by double-clicking
the field name and editing it in the dialog that opens:
19. In the Job Applications section, change the label of the following fields by
double-clicking the field name and editing it in the dialog that opens:
20. In the Reviews section, change the label of the following fields by double-clicking
the field name and editing it in the dialog that opens:
21. Move the following fields from the Positions section into the Position, Job
Application, and Review Fields section:
• Position Title
• Created By
• Created Date
• Days Open
• Functional Area
• Hire By
• Hiring Manager
• Open Date
• Status
• Travel Required
22. Move the following fields from the Job Applications section into the Position, Job
Application, and Review Fields section:
• Job Application Number
• Average Rating
• Created By
• Created Date
• Number of Reviews
• Status
Notice that we didn't include the Candidate field. We left it out because this report type is
available to all users, including hiring managers. As mentioned in the previous chapter, a hiring
manager might try to poach candidates that apply for other jobs, so it's best not to reveal
candidate names in reports.
23. Move the following fields from the Reviews section into the Position, Job Application,
and Review Fields section:
• Review Number
• Created By
• Created Date
• Rating
• Days Open
• Hiring Manager
• Job Application Number
• Open Date
• Position Title
• Review Number
25. Delete the individual Positions, Job Applications, and Reviews sections.
26. Click Save.
Your custom report type is ready! To try it out, go to the Reports tab, click Create New Custom
Report, and select the Other Reports report type category. The Positions with Reviewed Job
Applications report type is in the list below.