Multiple Measures on a Timeseries Chart - Salesforce Analytics Cloud - SAQL

A question I get asked a lot is how we can place multiple measures on a single time series graph in Analytics cloud. This can be achieved really quickly in SAQL / PIGQL.

The idea here is to project each measure for each line on the graph then add an extra column to the projection essentialy for grouping the graph. Once we have both of our measures projected we then union these projection sets to combine them.

Read More

The Ultimate Transitioning to Bindings 2.0 from Bindings 1.0 Guide.

This post inspired by and a large nod to [Robert Houston][1] whose nickname in our ecosystem is The Wolf. Most likely the best technical person on our platform. The Wolf recently wrote a piece I saw comparing Bindings 1.0 and Bindings 2.0 - this post is a view of this for the community. The idea of this post is to show all steps needed to build a full dashboard in Bindings 2.0 then show a comparison of Bindings 1.0 and Bindings 2.0 in a Copy/Paste scenario for reference. 

Read More

Moving Salesforce Analytics dashboards between Salesforce environments.

One of the issues with Analytics cloud is that there is no process to take Analytics cloud assets from a dev or test environment and push them into production. Basically what you need to do is rebuild all of the items again in production. Here are the steps just for the dashboard component, all of the other peices of a dataset/dasboard are the same including:

  1. Uploading the datasets into new environment / pulling from Salesforce
  2. Copying and pasting XMD from one environment to the other
  3. Downloading images and re add images to the new environment

How to move dashboards JSON between environments:

I want to move this simple dashboard from one of my pre sales environments to another pre sales environment. The dashboard looks like this:

Next, I want to show the sourcecode so you can see the id's of the dataset, dashboard and the environment.

Looking at this dashboard we can see that it is very simple and that we have used in our steps the "OnTime" dataset. This is the dataset that we will need to use in the new environment. Looking at the code below we can see there are specific environment variables.

  "_url": "/insights/internal_api/v1.0/esObject/lens/0FKB000000003sPOAQ/json",
  "_uid": "0FKB000000003sPOAQ",
  "edgemarts": {
    "emName": {
      "_type": "edgemart",
      "_uid": "0FbB000000002slKAA"

First thing we want to do is move to our new environment and make sure the dataset has been repulled form Salesforce or uploaded via CSV/API or middleware. Once this has been created, open the dataset and snap the lense to a dashboard.

Next step is to save the new dashboard to the same name as the dashboard we are moving across between environments in this case it is "Carrier Performance".

Once we have saved the dashboard, goto the onboard lens tool and access the dashboard JSON. The lens viewer can be found using the following instructions:

In your browser’s address bar, type the URL of the Create Lens page. For example, if your Salesforce instance is, type in your browser’s address bar.

Copy the JSON from the lens viewer and paste into a text editor

This is the JSON of our new dashboard, the next step is pretty simple. All we need to do is to take the "State" section from the dashboard JSON from the old environment and paste it into the "State" section in this json. The new dashboard JSON currently looks like the following:

We will now add the new "State" section to this dashboard JSON. It now looks like the below:

We can now add this to the new dashboard in the new environment via the lens viewer. Once this is completed your dashboard will look something like this:

This is a quick overview on the basics of moving the content of a dashboard from one environment to another. There are a number of things in addition to this mentioned at the start of the artice. These need to be applied manually to complete the dashboard.

Changing X & Y Axis Labels on Graphs - Salesforce Analytics Cloud

Recently I discovered that you could fully change the label including the AVG of OR sum of on the X & Y axis of a chart on Salesforce Analytics Cloud. Up until this point I had been building solutions that took this into consideration as something I couldnt change. There were a number of ways that we could deal with this:

  1. Hide the label in XMD
  2. Change the projection in a SAQL query to promote a label that was suitable ( So a calculation that is sum(column) / sum(Columnn) = avg_allcolumns
  3. Use a variety of graphical tricks to remove the "Sum of" component.

Below is an example of a label that we would want to change:

It turns out there is a way in the JSON to define this whole label. No longer do we need to use the "Sum Of" or "Avg Of" on our graphs. The change can be made by using the display option within the measure in the step in the Dashboard JSON. Below is the standard JSON Step of what we would see as part of a step that is created by default / has been created using the Dashboard designer in Salesforce Analytics Cloud.

As you can see in the code in the measures section we have "sum,Flights". This as a default is the was that the Salesforce Analytics graphics engine (Eclair) needs to see measures in order to display them in a graph. The same is when we use SAQL or PIGQL for queries, the projected measure for example must end in an aggregate and look like sum_Flights. The measures are also defined as sum,flights in the compact form section to allow the Eclair to graph the measure.

Using the display attribute in the measure step we can change the way that the measure is represented on the graph. In the above code you can see we added the following code to allow for the adjustment:

null, {
              "display": "New Label - All flights"

With the display code added to the step we now have this displayed on our graph on our dashboard.