Build Your Own Custom Maps With Einstein Analytics
We at Tengo work with many clients in building out integrative dashboards and analytics using Salesforce’s proprietary Einstein Analytics (EA) technology. This technology is a powerful tool that uses Artificial Intelligence to generate advanced analytics, provide more descriptive and diagnostic information, and personalize the data to complement the distinct requirements of the user organization. Within the Analytics application there are three main functions: Prediction Builder, Einstein Discovery, and Einstein Analytics. In this article, we will focus on Einstein Analytics and the distinct solutions it can provide for businesses.
Einstein Analytics is an amazingly useful tool to integrate within dashboards as it provides the possibility to incorporate third party data, customize layouts, and optimize report displays across devices and functionalities. A strong feature within the application is maps customization, a function that enables you to create a representation of your operational geo data to not only increase territory and control visibility, but also maximize resources and drive productivity. While Salesforce has geographical maps available by default, the maps have some limitations that disable users from generating detailed data analysis. Through Analytics, the user has the option to work with custom GeoJSON functionality, meaning that custom maps can be developed beyond the limitations of geographical maps. The only requirement for this development is that the maps must be sketched polygonally. Pictured below are two examples of how EA dashboards can be configured with custom maps and the versatility that is included within these functions.
As shown in images 1 and 2, the varied shades of colors symbolize the percentage of data represented. These maps provide strong visual representations of distinct data points and analytics necessary for business insights. This maps customization function helps seamlessly consolidate information in a visually appealing and easily-understandable fashion.
The Analytics tool can be customized in ways that go beyond the use of just color to portray statistical analysis. Other customization features include: Text Widgets, Number Widgets, Over 30 Different Types of Charts, Images, Tables, Filters, Dashboard Interactions, and more!
Stadium Seating Map Example
A good example of a process requiring the use of maps customization is when consolidating data on stadium seating. First, it is necessary to describe the context of our Stadium map. Let’s suppose that a company who sells stadium tickets needs to generate better analytics and visualization for their ticket sales. Their data model in Salesforce is currently structured as shown in image 3.
Within the data architecture we can identify one standard object and four custom objects. Let’s first pay attention to the Stadium Seating zone object. The ID of each seating area is stored within the Zone ID field. This field will be very important because, when making the GeoJSON file, the IDs you assign to each zone should match with this field in order to get the right location on the stadium map.
Our stadium dashboard contains bar charts showing up to three events, with each bar representing the number of people attending that event. By clicking on a specific bar you can then see the stadium for that event, and moving your mouse over the zones provides extra information such as capacity percentage of the zone, the zone ID, and the name of the event. The information portrayed on the dashboard is completely customizable as the chart can portray the number of tickets sold by age, sex, or the type of payment (Cash or Card). The customization capabilities will depend on the statistics and analytics most useful to your business.
How to Create a Customized Map
1. Create a GeoJSON File
First, make sure you have the image you want to convert into a map. Use whatever software you feel most comfortable with when converting your image into a GeoJSON format. There are multiple ways to do this, most popular being the inskape or QGIS software, both of which are open source. Using the QGIS software will immediately convert the image to GeoJSON format, but inkscape will require extra effort. First, it is necessary to convert your image to .svg format, the dxf and finally use a convertor to GeoJSON. The decision between inkscape or QGIS is fully dependent on the software you feel most comfortable using. In summary, this step involves converting a pixel image into a polygonal shape image. This will provide us with well-defined shape boundaries and enable us to assign an ID to each polygon. Make sure that each area has an ID that can match the custom map with a field that is in Salesforce.
Once the image has been converted to GeoJSON format, the field can be opened with a text editor and you will have a JSON object with the next structure.
Take into account if you want to use GeoJSON in Salesforce as it does not support point or line type geometry and only works in the context of multipolygon or polygon geometry. It is also important to consider that once the GeoJSON file is created, the ID should be at the same level as “type”: “Feature”, and can’t be the child of the properties elements. For example, in Image 6 above, the ID is a child of properties, and thus the code must be manipulated and the ID adjusted.
2. Create a Dataset
The next step involves preparing your data. If you have the data in Salesforce, go to App Launcher → Analytics Studio App → Create (button on the top right) → Dataset → then give your dataset a name.
Then select the option to create a new Dataflow, like the image above.
A window should then be displayed which allows the objects and fields to be selected, which should be included within the dataflow.
Finally, you will click Next → Create Dataset → OK Button and wait for the data to sync. Depending on how much information is being loaded, this process may take a few minutes.
3. Steps to Display the Data in the Stadium Custom Map
Go to the Analytics Sutdio Home Page and click on All Items → DATASETS to find the data set you just created. Click on the data set and it will open a lens similar to the image below.
Within the lens, configure the Bar Length with Sum of Capacity Percentage, and assign Event Seating Zone in the bars option. Select the chart icon, pick Map chart, then click formatting.
Look for the picklist map type and click on the “+” button. Then, click on Upload GeoJSON and select the file you created, give it a name and select Done.
Now you should have the Stadium map portraying all of your events. You can customize the Event Name by clicking on the Left Panel in the Trellis option. From there your map should look something like the image below.
Now that you understand how to implement your own maps customizations within Einstein Analytics, the capabilities for data analysis and analytics become endless. This tool provides immense versatility and high customization capabilities. With this solution, you can turn basically any image into a map that displays complex analytical insights. This feature enables you to bypass traditional charts and spreadsheets and dig even deeper through visually appealing map integrations. The possibilities are endless! If you are interested in learning more about Einstein Analytics and map customizations, give us a call! We at Tengo specialize in these solutions and would be more than happy to help you improve your analytical capabilities and operational efficiencies.
- Video – Custom maps in Einstein Analytics: https://www.youtube.com/watch?v=Kec0nFHkJYc
- Building Custom Maps: https://developer.salesforce.com/blogs/developer-relations/2016/08/art-possible-building-custom-maps-wave.html