Popular Help Content
(Click Watch in the top right corner if you want to get an email when this tutorial is updated)
This page walks through building an Excel dashboard with data from CommCare. Similar to how Excel helps people build spreadsheets, CommCare enables anyone to build a free customized mobile app - no IT background required. After collecting data with your CommCare app (don't yet have an account? Sign up for a free trial here.) you can download your data and load it in Excel to create dashboards.
This feature (Excel Dashboards) is only available to CommCare users with a Standard Plan or higher. For more details, please proceed to CommCare Software Plan page.
Note: Mac users - Excel dashboard integrations are primarily designed for PCs. Mac users should consider data extraction methods such as the data export tool, manual exports, or the daily saved export.
|Table of Contents|
This tutorial will walk you through how to use Microsoft Excel to build a simple dashboard using CommCareHQ data exports. CommCare is an open source platform that enables people without a tech background to design and deploy their own mobile applications. By the end of the tutorial you will be able to create a dashboard that:
The intended audience for this page is a CommCare administrator who is familiar with CommCareHQ and has some experience in Excel. The The end result will contain the following:
**** Download the Example Dashboard ****
A graphical dashboard
Individual pages with data:
User definable filters:
Step 1: Create Custom Export in HQ for the project
- See this Proceed to the Data section of CommCareHQ.
- Select Excel Dashboard on the left-hand side.
- See this Data Export Overview page for details on creating the data export: Data Export Overview
- Name your export
- For Default File Type choose Web Page (Excel Dashboards) as the Default File Type.
- Choose Automatically convert dates for Excel
- Choose Create a Daily Saved Export
- Be sure to rename your Display columns to how you want them to display in your reports.
- Save the export
Step 2: Copy the Web Address of your saved export
When you chose to Create a Daily Saved Report in step 1, this meant every night CommCare will generate the export with all the latest data and save it. We will use this report to pull into Excel.
the Excel Dashboard Integration report that we created to populate the dashboard. Follow these steps to configure your Excel sheet to pull the latest data from the report:
- In the main Exports section you will see your saved daily export.
- Click Update Data button to generate the first report.
- Right-click on the Dowload link to the export
- Choose Copy Link Address in the menu. This You may need to refresh the page to confirm that the update is complete.
- Select the Copy Dashboard Feed Link button.
- Select the Copy Dashboard Feed Link button again to copy the URL. This will copy the URL of the export file so you can paste into Excel in the next step.
- Alternatively, you could simply highlight the URL to copy it.
Step 3: Create the Excel Connection to your export
- In Excel, Create a New File.
- You will have a blank Excel file now.
- Go to a blank tab in your workbook. Rename that sheet "Raw Data".
- Select the top-left cell (A1).
- Now we will pull in the data from the Excel file
- Choose the Data menu
- Choose From Web in the "Get External Data" section (NOTE: If you are getting issues when trying to import data to the web, you may want to use From Web (Legacy) instead of the standard From Web. Please see Alternative Web Data Access Method for Step 3, below)
- Be sure you have Copy link address from step 2 above so it is on your clipboard.
- The "New Web Query" window appears.
- In the "Address" bar at the top, Paste the link you address you copied in Step 2 above. It should be something like "https://www.commcarehq.org/a/excelreportingdemo/reports/export/saved/download/96c41fd6fb9be6119ad32467254cbc9a/"
- Click Go
- The "Windows Security" window appears. Type your CommCareHQ username and password. (NOTE: Accounts with Two-Factor Authentication (2FA) enabled are not supported at the moment)
- The export will be displayed to you in the Web Query Window
- Click the second Yellow Arrow above the table of data (not the very top one). This will select all the CommCare data in the export.
- Click Import
- The "Import Data" window appears.
- Click Properties
- The "External Data Range" window appears
- In the top of the window, name your export "Raw Data"
- Choose Save query definition
- Untick Choose Enable background refresh
- Choose Preserve Cell Formatting
- Choose Adjust column width
- Choose Overwrite existing cells with new data, clear unused cells
- Choose Fill down formulas in columns adjacent to data
- Click OK
- Click OK again
- The data is pasted into the empty worksheet
Alternative Web Data Access Method for Step 3
Some users experience errors when attempting to import data using the standard "From Web" functionality. Specifically, you may encounter a persistent error similar to:
Details: "The credentials provided cannot be used for the Web source. Please update the credential type through a refresh or in the Data Source Settings dialog to continue. (Source at https://www.commcarehq.org/.)"
If you are encountering this error, please make sure Microsoft Office and your OS are up to date, and that your computer has been restarted since performing these updates. If, after updating everything, you still encounter this error, you may find more success using a legacy version of the From Web tool. The following instructions allow to access the tool in Excel 2016:
- Navigate to File -> Options to open the options window.
- Click Customize Ribbon in the pane on the left.
- In the dropdown under Choose commands from: select All Commands
- Find From Web (Legacy) in the scrolling menu on the left.
- In the right-hand menu, select the Data
- Click New Group to create a custom group. Rename it if you want.
- Select the group you just created and click Add >>
After following the above steps, you should now have access to From Web (Legacy) in the Data ribbon. Now, whenever you want to import data from the web, instead of clicking From Web in step 7, you will select From Web (Legacy).
Step 4: Name your raw data for easy reference later
- Create a new tab called "Expected Delivery Date"
- Select the top-left cell (A1) in this tab
- In the Insert menu choose Pivot Chart from the PivotTable icon
- In the window that pops up, click "Table/Range" text box
- Type "raw_data" into the box. This references the data range we created in the step above and is a lot easier than selecting all the columns each time.
- Click Ok.
- This creates a blank pivot table. (If this doesn't work it's likely because the range is referencing only to the first tab. Go back to step 4.2, then click "Formulas" at the top, next to "Name Manager" click on "Define Name", enter "raw_data" under "Name" and make sure "Scope" is set to "Workbook" as this will ensure the reference can be used in different tabs, click OK)
- Click the pivot table on the left
- In the Field list on the right, do the following:
- Drag Expected Delivery Date to "Row Labels"
- Drag District to "Column Labels"
- Drag District to "Values"
- Note: If you don't see the "Pivot Table Field List" on the right, click the Options menu at the top and choose Field List in the top right.
- This will be the result:
- We now have the data we want but it needs to be formatted:
- You can drag the graphical chart to the side to get it out of the way
- Next, we need to display the dates as months instead of days
- Right-click on any of the dates in the pivot table and choose Group
- Select Months in the list the appears and choose OK
- This groups all the EDDs into monthly buckets
- The graph defaults to a bar chart, but you can change it:
- Right-click the graph and choose Change Chart Type
- Select the line graph you'd like
- Set the table to update automatically
- Highlight the pivot table
- Choose the Options menu and in the top-left type the name "EDD Graph"
- Click Options below where you just typed
- On the Data Tab select Refresh data when opening the file
- Finally, rearrange the layout by inserting rows above table to move it down and drag the chart to the top of the page.
- You can add titles and legends with the Layout menu
- You're final result should look like this:
If Excel hangs during the refresh, disable Enable Background Refresh on all data connections. This is a known problem for spreadsheets with multiple web-based data connections. Find it under Data -> Connections -> Select Connection, click Properties -> unselect Enable Background Refresh.
NOTE: The data needs to be pulled/downloaded every 35 days (see warning label below) to maintain an active data connection/link. This can be achieved by clicking on Refresh All in the Excel dashboard (see instructions above). Otherwise, the data connection will expire and Step 3 needs to be repeated to re-establish a data connection.
Step 11: Send to Others
If you just send the Excel file to others they will be prompted to enter login credentials in order to refresh the data. If you don't want this to happen, you can do the following:
Option 2: Export to pdf (might not be available on all computers)
- Chosse File - Save As
- Select PDF as the File Type
- Chosse File - Save As