Extract External Data into Analytics
Time to get that data into 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. So 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 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:
Your objective in this unit is to extract this data in Analytics so that it can later be added to the Salesforce data you’re going to extract. Here’s a reminder of where we are in the data journey.
When you extract data from a CSV file, 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 an Analytics lens or dashboard.
Analytics does a pretty 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 Code
- 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. But look out for fields like this that contain numeric values but aren’t actually measures. Nobody wants to do math on an SIC Code, zip code, or Id field, but Analytics thinks you do and identifies fields like these as measures. There’s not a lot you can do about it now, but when you upload the data you get the option to change these fields 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. Analytics doesn’t usually get tripped up by these fields, so there shouldn’t be anything for you to do!
- Industry Size
- You probably want to do math on amount fields like this, so this is the perfect candidate for a measure. 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 like this and remove any other non-numeric characters if you want the fields to be measures.
- Last Updated
- 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 date fields to ensure that values are in one of the supported formats. If 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 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 Analytics, and you can tweak it if you need to.
Now that you’ve prepared your CSV file, it’s time to upload it to Analytics using the CSV uploader tool. You also create an app for the new dataset along the way.
- Download the SIC Descriptions CSV file to your desktop from here.
- If you’re not already logged in, log in to the Developer Edition org that you signed up for in the previous unit.
- From the App Launcher (), find and select Analytics Studio.
- In the Analytics Studio, click Create and select App.
- You’re creating an empty app, so click Create Blank App.
- In the Name your app field, enter Sales Performance Datasets.
- Click Create.
At the top of the app page, click Create and select
- Click CSV File.
- Click Select a file or drag it here.
Navigate to the CSV file that you downloaded earlier, select it, and then click
Analytics uses the file name as the name for the new dataset, and selects the app.
In the Dataset Name field, change the name to SIC
The Edit Field Attributes screen appears, giving you a preview of the data you’re about to extract to Analytics.
The icon in each header tells you the field type:
If 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 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.
- Click the SIC Code column.
The field attributes appear in the panel on the right.
- From the Field Type picklist, select Dimension.
You also checked the date field in the CSV file to ensure Analytics sets the type and format correctly. So let’s check that too.
- Click the Last Updated column.
The field attributes appear in the panel on the right.
Looks like 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. Analytics doesn’t know which, so it picks the European format. You want the US format. You can easily change it here.
- From the Date Format picklist, select M/d/yyyy.
As we predicted, 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.
Analytics uploads the data and gives you a view of progress as it creates the 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 click Close for now.
OK, time for a hot beverage. When you get back, you can check that the dataset has been created.
Behind the scenes, 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 Analytics has on the go. It’s easy to check the progress of jobs through the data manager.
In Analytics, click the gear icon ()
and then click Data Manager.
The data manager opens in a new browser tab. The first thing you see here is the Monitor tab, with the Jobs subtab selected by default.
Look for your job in the list. The job name starts with “Upload” and then the name of the
CSV file, SIC_Descriptions.
- If you’re interested in seeing what Analytics has done to extract your data, click the arrow (>) in front of the job name.
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.
- On the left of the data manager, click the Data tab.
- On the right of the SIC Descriptions dataset, click and select Explore.
- On the left of the new lens, under Bar Length, click the Add a measure button (+).No measures here! Remember, we didn’t set any measures in the field attributes.
- 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 Analytics has set them as a date or dimension.
Congratulations! You’ve just turned your CSV file into an Analytics dataset using the CSV uploader tool.
Next up: Bring your Salesforce data into Analytics.