Welcome to the first part of this 2-part blog! In this part, we’re going to do build a dataset for Einstein Analytics!

It’s about as exciting as it sounds. After we do all the setup we’re going to do the fun part and build an Einstein Analytics Dashboard! In part 2 we’ll give a bit more information about Analytics and build the dashboard using this dataset.

What is a dataset? Well, I’m glad you asked (or I’d have nothing to write about). A dataset is a collection of objects and fields that we combine together to be able to use for when we build an Analytics dashboard. If you’re familiar with the Report Builder you can sort of think of it as a Report Type except it allows more objects that are not related to each other. Let’s get started.

Within Analytics studio go to Data Manager –> Dataflows & Recipes –> Create Dataflow: If you’re using a developer org then you will not be able to create an additional dataflow, but you can save and then edit the one currently there to get a feel for how this works.

 

Name your Dataflow whatever you wish to call it; This is for your reference.

There is now a blank grid with a toolbar (if using the Developer Org then this will have data in it). This is where we’re going to input our data from Salesforce. NOTE: Data can also be used from an external source, but we won’t go through that here.

On the toolbar click the small Salesforce cloud button with a downward facing arrow. This button is called sfdcDigest (catchy I know).

This button is basically how we input what data we want to see when building a dashboard. If you’re familiar with Salesforce’s report builder, then this part is the equivalent of picking the objects and fields that you’re using.

This will bring up the sfdcDigest (still catchy) screen. Ahead will be a screenshot of the finished Digest (or Digestion) but we’ll go through the steps now.

Firstly, the ‘Node Name’ field is the label you wish to give the Node. I generally give it the same name as the object that I will be using. ‘Accounts’ if I’m using the ‘Account’ objects.

For the source object, we will select the object which we wish to acquire data from. In this case, it will be ‘Account’

To the right of the ‘Fields’ field, there is a small link called ‘Select Fields’. When you click, a menu will appear in your Account fields. Select which fields you’d like to see in a dashboard. NOTE: I always select the record ID. Although we probably won’t want to use it for a dashboard, this helps with joining this object with other objects.

The next two fields are for when we want to only acquire specific records and these boxes needed to be filled with code of either JSON (Filter Conditions) or with a SOQL query (Complex Filter Conditions). Since we want to bring in all account records we will disregard these fields.

Finally, click ‘Create’

Your little ‘Accounts’ node will now appear. Yay!

Now we want to do the same except this time we’ll be using the ‘Opportunity’ object.

One thing to remember: Include the record ID. For this new ‘Digest’ we’re also going to select the field that allows us to lookup Accounts. That is how we’re going to link the two objects together.


NOTE: The date field is also selected. Now we have our two objects just sitting, being lonely. We’re a matchmaker so we’ll bring them together. We do this by ‘Augmenting’ the two. Back to the toolbar, we’ll now click on the ‘augment’ button, which shows a box going on top of other boxes.

Again, we’ll go through the steps and there will be a screenshot with the finished result at the end.

Just like before with our Node names, we can label this however we want. I usually combine the names of the objects with ‘Augment’ at the beginning so I know what I’m doing at this node E.g. ‘Augment Opps Accounts’

Things can get a little confusing here with the left and right source. I’ll try and explain it. All the fields are taken from the left source whereas you can select the fields brought in from the right source. Also, the left source is the object which it takes the records from. E.g. Accounts has 100 records and Opportunities has 300 records. If Account is the left source then when we build a dashboard it will show those 100 records. Make sure to put the object you’re primarily reporting on in the ‘Left Source’

For the ‘Left Source’ we’ll select the ‘Opportunities’ node. Then we’ll select the “AccountId” for the ‘Left Key’.

Next is the relationship field. For this field, I usually just put in the two objects that I’m combining, similar to how I named the node. NOTE: Make sure there are no spaces in this field. I named this field ‘Opps_Accounts’. Having a space will cause an error when trying to do a later step.

Now for the ‘Right Source’ we’ll select the other node (Accounts) and the ‘Right Key’ will be the “Id”.

For the ‘Right Fields’ field, we will select all the fields that are available. Notice that these fields are the same as the fields we put into the ‘Accounts’ node previously. Fieldception.

Lastly, we’ll keep the Operation as it is.


Now click ‘Save’ and look at that wonderful node with lines you created!

Going back for a second.  Id’s are important since they make it easier to connect two separate objects. Having the Account Id field in the ‘Opportunities’ node and the ‘Id’ field in the ‘Accounts’ cause them both to have the same data. Since they have the same data, Analytics can connect them.

One more step before we can start building our dashboard.

Now we must ‘Register’ the data. Back to the toolbar, there is an option to the very right called ‘sfdcRegister’ (a hexagon with a tick inside).

Once again, label the Node. E.g. ‘Register Opps Accounts’

Select the “Augment Opps Accounts” node as your ‘Source Node’

For the ‘Alias’ field just put in the objects which you are registering: ‘Opps_Accounts’

Same as with the ‘augment’ node for the name; make sure it has no spaces. ‘Register_Opps_Accounts’.

We will disregard the ‘Sharing Source’ and ‘Security Predicate’ fields for this example.

Now we can see our finished Dataflow!

Now we must run the dataflow, so Salesforce can put all our data together. Click the ‘Run Dataflow’ button near the top of the page. The button might say ‘Update Dataflow’ so update it then run it.


When you click the ‘Run Dataflow button’ a popup will appear saying that your dataflow was queued. You can either return to the dataflow or go to the data monitor to see it happen. Clicking on the data monitor button will take to the ‘Monitor’ screen which shows you all your jobs. There you’ll be able to the ‘Dataset Build’ dataflow that we built.

Now if you go back to Analytics Studio then navigate to the ‘Datasets’ tab you should see your dataset. It will be ‘Registered_Opps_Accounts’ (whatever you named the ‘Register’ node). That’s it! Yay! *pats self on back*

Now we’re ready for the fun part: Building the actual dashboard! I hope you enjoyed the read, the next one will hopefully be a bit more exciting so stay tuned for the second part of the blog.

 

– Jack

Leave a Reply

Your email address will not be published. Required fields are marked *