Skip to main content
Free Agentforce workshops and AI Certifications: Learn more. Terms and conditions apply.

Extract External Data into CRM Analytics

Learning Objectives

After completing this unit, you’ll be able to:

  • Prepare external data before bringing it into CRM Analytics.
  • Upload a CSV file of external data.
  • Monitor and verify an external data upload.

Extract External Data Overview

It’s time to get that data into CRM Analytics so the sales leadership team can have its performance dashboards. It’s your job to administer Salesforce and set it up for the sales team. You know that most of the data they want to look at is already there, in the Opportunity, Account, and User objects. But some of it, if you recall, is pulled in from an external source. No problem at all for CRM Analytics! Let’s dig a little deeper.

The Sales Operations team at your company uses a Standard Industry Classification (SIC) code field on each account to identify its industry. Sales leaders have a hard time deciphering these codes, preferring instead a good old-fashioned description. So, Sales Operations has provided a CSV file with all the SIC codes they use, complete with descriptions. Here’s a snippet:

SIC Description CSV file snippet

Your objective in this unit is to extract this data in CRM Analytics so that it can be added to the Salesforce data you’re going to extract. 

Prepare Your CSV Data

When you extract data from a CSV file, CRM Analytics makes assumptions about what type of data it is, based on the values it sees in each field. It assigns each field a type of measure, date, or dimension. These types are important because they determine how you interact with a field in a CRM Analytics lens or dashboard.

CRM Analytics does a good job of assigning the correct field type, but sometimes you need to help determine the right type. So, let’s walk through the SIC Descriptions CSV file, field by field, to see what you need to do.

SIC Description CSV

SIC Code

CRM Analytics identifies a numerical field like this as a measure.

A measure is a field that you can perform calculations on, such as sum and average. CRM Analytics recognizes currency symbols, commas, and decimal points in numerical data, but beware. If it sees any other non-numeric characters, it sets the field to a dimension, and you can’t do math on it. So review numeric fields and remove any other non-numeric characters if you want the fields to be measures.

But look out for fields like this that contain numeric values but aren’t measures. Nobody wants to do math on an SIC code, zip code, or ID field, but CRM Analytics thinks you do and identifies fields like these as measures. There’s not much you can do about it now, but when you upload the data, you can change these field types to dimensions. So, for now, just make a note of them. 

SIC Description 

Any field like this, that contains non-numeric characters, is identified as a dimension. You can group and filter on dimension fields. CRM Analytics doesn’t usually get tripped up by these fields, so there shouldn’t be anything for you to do! 

Last Updated 

CRM Analytics recognizes all common date formats and sets a field like this as a date. It even sets the format for you and is smart enough to distinguish between US and European date formats. However, take a moment to review the date fields to ensure that values are in one of the supported formats. If CRM Analytics doesn’t recognize the format, it sets the field to a dimension. When this happens, you lose some of the cool date grouping and filtering functionality. Also, check that your dates are all in the same format. For example, if CRM Analytics sees a mixture of US and European formats, it uses the European format. 

Column Headers 

Check that the column headers are correct because these become field labels in your dataset. You can fix them in the CSV before you proceed. Or you can wait until you upload the file, where you get another chance to change them.

The good news is that you get a chance to preview how your data appears in CRM Analytics, and you can tweak it if you need to.

Upload Your CSV Data

Now that you’ve prepared your CSV file, it’s time to upload it to CRM Analytics using the CSV uploader tool. You also create an app for the new dataset along the way.

Note

When you upload a CSV file, CRM Analytics extracts the data and creates a dataset. You can explore this new dataset right away, but in this case, a long list of SIC codes and descriptions doesn’t make for exciting viewing. Instead, you’ll use this dataset later to prepare the final sales dataset. For the time being, think of it as a holding area for the SIC data.

  1. Download the SIC Descriptions CSV file to your desktop from here.
  2. If you’re not already logged in, log in to the Developer Edition org that you signed up for in the previous unit.
  3. From the App Launcher (App Launcher icon), find and select Analytics Studio. Analytics Studio opens in a new browser tab.
  4. In the Analytics Studio, click Create and select App.
  5. You’re creating an empty app, so click Create Blank App.
  6. Click Continue.
  7. In the Name your app field, enter Sales Performance Datasets.
  8. Click Create.
  9. At the top of the app page, click Create and select Dataset. Creating a dataset from within an app automatically selects the app name for you. Hey, every little bit helps!
  10. Click CSV File.
  11. Click Select a file or drag it here.
  12. Navigate to the CSV file that you downloaded earlier, select it, and then click Open. If the file is within dragging distance, you can drag it into the Select a file or drag it here box instead, and save yourself a few seconds.
  13. Click Next. CRM Analytics uses the file name as the name for the new dataset, and selects the app.
  14. In the Dataset Name field, change the name to SIC Descriptions. CRM Analytics detects certain properties of your file, such as the delimiter and encoding. You can review these properties in the File Properties Detected box. To make changes, click Menu button in File Properties Detected field and then click Edit.
  15. Click Next. The Edit Field Attributes screen appears, giving you a preview of the data you’re about to extract to CRM Analytics.
    The Edit Field Attributes screen, showing a preview of data to be extracted into CRM Analytics.

As previously promised, now is your chance to fix your data before getting it into CRM Analytics. Think back to the things you were looking out for when you prepared the CSV file. You wanted to make sure that the fields were set to the correct type: measure, date, or dimension. You also checked that the field names were correct. To see if CRM Analytics got the field types right, look at the field headers in the preview. The icon in each header tells you the field type.

Note

Can’t see the field you want to check? Use the fields panel on the left to search for the field, then click the field to jump to its column.

If CRM Analytics made a mistake, you can click a column to view and edit its attributes in the Field Attributes panel on the right.

In your data, it looks like CRM Analytics has identified the SIC Code field as a measure. That identification is understandable, but it’s not what you want. If you leave the field type as measure, you can add SIC codes together (not useful), but you can’t group your accounts and opportunities by SIC code (very useful). So, let’s change the type.

  1. Click the SIC Code column. The field attributes appear in the panel on the right.
    SIC Code field attribute
  2. From the Field Type picklist, select Dimension.

You also checked the date field in the CSV file to ensure CRM Analytics sets the type and format correctly. So let’s check that too.

  1. Click the Last Updated column. The field attributes appear in the panel on the right.
    Last Updated field attribute

Looks like CRM Analytics got the data type right but set the format to d/M/yyyy. All the dates in the CSV file are 1/10/2017, which is either January 10 if using the M/d/yyyy format popular in the US or October 1 if using d/M/yyyy format popular in Europe. CRM Analytics doesn’t know which, so it picks the European format. If you want to use the US format, you can easily change it here.

  1. From the Date Format picklist, select M/d/yyyy.

As we predicted, CRM Analytics had no trouble correctly identifying the SIC Description field as a dimension. So, it looks like you’re done here. Just click Upload File to finish up.

CRM Analytics uploads the data and gives you a view of progress as it creates the dataset.

The Creating dataset dialog, showing the progress in creating the SIC Descriptions dataset.

There’s a link here that takes you to the data monitor to see how the dataset is getting on. But let’s take a break here, so, if the progress dialog hasn't closed, click Close. Close the Sales Performance Dataset tab.

OK, time for a hot beverage. When you get back, you can check that the dataset has been created.

Monitor the Data Job and Verify the New Dataset

Behind the scenes, CRM Analytics creates a job for your new dataset, which runs in the background. How long this job takes to run depends on how big your CSV file is and how many other jobs CRM Analytics has on the go. It’s easy to check the progress of jobs through the data manager.

  1. From the App Launcher (App Launcher icon) in the upper right, find and select Data Manager. The data manager opens in a new browser tab. The first thing you see here is the Monitor tab.
  2. Look for your job in the list. The job name starts with the name of the CSV file, SIC_Descriptions, followed by “Upload flow - overwrite”.
    The Jobs Monitor, showing the SIC_Descriptions dataset job has run successfully.
  3. If you’re interested in seeing what CRM Analytics has done to extract your data, click the job ID.

If all’s well, the job status is Successful. If not, try retracing your steps and loading the data again.

Now, it’s time to check the dataset itself. Check such things as field data types and date formats again in the live dataset. So, find the dataset and take it for a spin.

  1. On the left of the data manager, click the Data Assets option.
  2. On the Data Assets tab, on the right of the SIC Descriptions dataset, click dropdown menu button and select Explore.
  3. On the left of the new lens, under Bar Length, click (+), the add a measure button.
    Click plus below Horizontal Axis to add a measure in a lens

No measures here! Remember, we didn’t set any measures in the field attributes.

  1. Under Bars, click (+), the add a group button. Check that your three fields, Last Updated, SIC Code, and SIC Description, are here. This confirms that CRM Analytics has set them as a date or dimension. Close the New Lens browser tab.

Congratulations! You’ve turned your CSV file into a dataset using the CSV uploader tool.

Next up: Bring your Salesforce data into CRM Analytics.

Resources

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback