© Johan Yu 2019
J. YuGetting Started with Salesforce Einstein Analyticshttps://doi.org/10.1007/978-1-4842-5200-0_5

5. Lens

Johan Yu1 
(1)
Singapore, Singapore
 

When we explored the dataset and played around with extended etadata (XMD) in Chapter 4, without our awareness, we open the dataset as a new lens. A lens is a view of a dataset; we can use it to explore the data and to get data insight. We have options to explore the data in a lens as a chart or table, including using a special query language called SAQL. Einstein Analytics provides many types of charts and table for users to explore the data, including to use conversational exploration. We will discuss all of them later in this chapter.

If we compare lens with Salesforce report, there is some similarity, but not the same. When you open a dataset, it will open as a lens with one dataset (you can add other datasets from SAQL mode), while Salesforce report can contain multiple related objects, depending on the report type used. A dashboard in Salesforce requires reports as the data source, while dashboard in Einstein Analytics does not need lens as the data source but directly retrieves from the dataset.

In this chapter, we will learn everything about lens including
  • Einstein Analytics app

  • Explore dataset with chart, table, and SAQL

  • Explore dataset with Conversational

  • Clip lens to designer

  • Download and share data

Einstein Analytics App

In this chapter, we will discuss lens; you can store a lens into an app, whether private, shared app, or public app. Let us discuss a bit on app before starting our discussion on lens.

You may have heard “app” term earlier in the previous chapters in this book, so let us get the right term on what “app” means in Einstein Analytics. If you look at Analytics Studio user interface, between “ALL” and “DASHBOARDS” is “APPS”; so what is this app about? Apps provide containers for sets of related dashboards, lens, and datasets.

Apps also control user visibility and accessibility to the items within that app, whether as manager, editor, or viewer. Einstein Analytics allows dashboard or lens to use the dataset from different apps; this may cause errors when the user opens the dashboard and unable to open the dataset stored in other apps, where the user does not have access to the app.

Just to be clear, the app here has nothing to do with the mobile app.

Creating App

From Analytics Studio, click Create button, then select App. See Figure 5-1.
../images/480970_1_En_5_Chapter/480970_1_En_5_Fig1_HTML.jpg
Figure 5-1

Create new app

Depending on your Einstein Analytics license, when creating an app, you may be asked if you want to create from Blank App or start from template. For now, let us use Create Blank App button, then enter the App name; I’ll enter “Regional Sales,” and we just have a brand-new app created. Figure 5-2 shows within an app there are dashboards, lenses, datasets, and details. Since this is a new app, we have nothing in that app yet.
../images/480970_1_En_5_Chapter/480970_1_En_5_Fig2_HTML.jpg
Figure 5-2

A new app created

Run App

See Figure 5-1, at the end of the App name, for example, Shared App; notice there is a link called “Run App” at the end of the app, and this is available for all apps. Click “Run App,” or open the app and click “Run App” button; this will open lens or dashboard stored; by default it would be in the alphabetical order; however, you can edit the list to hide or reorder the list (see Figure 5-3).
../images/480970_1_En_5_Chapter/480970_1_En_5_Fig3_HTML.jpg
Figure 5-3

Run app and ability to Edit List

Share App

Sharing app in Einstein Analytics is simple; this is similar to sharing dashboard folder in Salesforce. Click the arrow at the end of the app, or open the app and click the share icon. You can share the app by user, group, or role (option to include subordinates) (see Figure 5-4).
../images/480970_1_En_5_Chapter/480970_1_En_5_Fig4_HTML.jpg
Figure 5-4

Give app access to other users

Exploring Dataset

Once we bring the data into Einstein Analytics, normally we should verify that the data is correct, from data completeness, quantity, and quality. Completeness means the fields are complete as we expect and no missing fields; otherwise we need to re-upload the dataset or modify and rerun the dataflow. Quantity means the number of rows is complete, with no missing rows. Quality means all the field contains the right values with the correct data type.

Using Chart in Lens

From the Datasets tab, find the dataset, and click the dataset name; by default system will open the dataset as a new lens with a simple chart (see Figure 5-5) and contain the following setup :
  • Bar chart.

  • Bar length is the count of rows.

  • No grouping.

  • No filters.

../images/480970_1_En_5_Chapter/480970_1_En_5_Fig5_HTML.jpg
Figure 5-5

New lens

With this simple chart, we can verify the data quantity, and from the chart, we can see the dataset have 1K of rows; we can verify this from dataset properties too (see Figure 5-5) and look for “Count of Rows.” However, with this chart, we still cannot verify if the dataset contains complete fields, field type, and value of fields; we can change to table mode and select Values Table to verify those items.

Before we discussed table mode, let us explore common things we can do in chart mode and analyze data using chart mode (see Figure 5-6):
  • Change bar length to Sum, Average, Maximum, Minimum, Unique, Median, First, Last, Stddev, Stddevp, Var, and Varp. All of them are only applicable for measures field, with exception of Unique which can be used for any field. I am not going to explain each of the functions, but it is good to familiarize each of them.

  • Add additional bar length: With this you can analyze multiple measurements, such as count of rows and sum of annual of revenue.

  • Add bars: This means that we are going to have new grouping in the chart.

  • Add filters: We can add multiple filters for multiple fields, but a field only can be defined once. We can can apply filter logic OR and AND.

  • Change chart type: Einstein Analytics offers more than 30 chart types for us to use, but remember each chart type has its own properties, so your existing selection may be removed if the new chart does not have such properties or move as other properties. If you are confused which is the best chart suited, click “Suggested Chart” to let Einstein Analytics suggest a few options based on the data and selection.

  • Apply chart formatting: You can set chart title, font size, show axis, show legend, and so on.

../images/480970_1_En_5_Chapter/480970_1_En_5_Fig6_HTML.jpg
Figure 5-6

Analyze data with chart

Using Table in Lens

Let us switch to the table mode by clicking the “Chart Mode” icon, then select “Values Table ” (see Figure 5-7).
../images/480970_1_En_5_Chapter/480970_1_En_5_Fig7_HTML.jpg
Figure 5-7

Switch to Values Table

If you remember in Chapter 4, we discussed that we can set default fields for a dataset using extended metadata. If default fields for the dataset have been configured, switching to table mode will give us those default fields as table columns.

Actions configured in extended metadata will be applied too in table mode, from rename field label, edit values, and format number.

Here are a few things you can configure on the table (see Figure 5-8):
  • At the bottom of the left panel, look for Query Limit; by default it will show 100 rows only; you can edit to set the query limit up to 10,000 rows.

  • Add or remove fields easily by clicking the pencil icon at the left panel; you can also reorder fields by dragging and dropping the fields accordingly.

  • Click the formatting (paint) icon at the right to format the table with spacing, color, header, and so on.

  • Click the table header to sort the table ascending or descending by a specific field.

../images/480970_1_En_5_Chapter/480970_1_En_5_Fig8_HTML.jpg
Figure 5-8

Values Table

Using Values Table, we will able to verify if the dataset contains all fields that we need to build a dashboard and if all fields contain correct values. We cannot verify that in chart mode; however, chart mode allows you to group data and sort it easily, so we can easily analyze the data on the fly, or get percentage of each group, or to get data trend over a timeline.

Saving Lens

After dataset opens as a new lens, hit save (floppy disk) icon on the top right corner to save the lens configured, so you can reuse the lens in the future. You can store it into “My Private App” if you do not want anyone else to touch it, or to a public app if need to share with your team or other users. Enter the lens title and optional for description.

When you save a lens, the table or chart, including all the filters, fields, grouping, sorting, and formatting, will be stored accordingly for future usage. If you have edited the chart or table with SAQL, it will be stored too.

When opening a lens and saving it to a different app, Einstein Analytics will move the app to the new app, so it is not a Save As. If you need to clone the lens, click … icon at the topright of the screen, then click Clone in New Tab (see Figure 5-9).
../images/480970_1_En_5_Chapter/480970_1_En_5_Fig9_HTML.jpg
Figure 5-9

Clone lens

Present Lens

Next to Save icon is Present icon , the purpose of this button is to show the lens in the web browser full screen. Press Esc key to exit from full-screen mode. You can also use just the letter p to enter and exit the presentation mode.

This is usually useful when you need to present the lens to the audience and not disturb by other things, or when you need to analyze the dataset with more real estate.

Explore with Conversational

When you explore lens with chart mode or table mode, you may notice there is a text box above the chart or table with the following sentences “What do you want to see? Just start typing…” . If you do not see this box, make sure Conversational Exploration has been enabled. Navigate to the Setup menu, type Analytics in Quick Find textbox, then click Settings (see Figure 5-10).
../images/480970_1_En_5_Chapter/480970_1_En_5_Fig10_HTML.jpg
Figure 5-10

Enable conversational exploration

Let’s go back to the lens; if you save it earlier, click Lenses tab, and the lens should appear at the top.

Note

In Lenses tab, notice the last column “Data Refreshed”; this tells us when the dataset last refreshed, and this date time is similar with “Data Refreshed” in the Dataset tab.

Conversational exploration means to ask questions on the dataset using nontechnical language and get a quick answer as a chart. This is useful when you need to analyze dataset quickly.

How could we interact with the dataset with this method? See Figure 5-11; click the text box, and Einstein will show you a few suggestions on what you can ask. A conversation can begin with “show me,” “what is,” or begin with a dimension like “industry,” begin with a measure like “amount,” “top x,” and so on. You even can include filters in the conversation to narrow the result area.

Here are a few sample questions you can ask based on fields in the dataset:
  • Top 2 annual revenue by account type

  • Show count of rows by account type

  • Show me sum annual revenue by owner id

  • Show me avg employees by account type

  • What is annual revenue for previous year

Ideally, the question should contain a measure field for Einstein Analytics to build the chart. All parameters or filters will be automatically entered based on the questions, and you also will be able to modify the parameters and filters manually as needed (see Figure 5-11).
../images/480970_1_En_5_Chapter/480970_1_En_5_Fig11_HTML.jpg
Figure 5-11

Converse with data in lens

Clip Lens to Designer

An icon next to Present with scissors icon is called Clip to Designer. The purpose of this function is to add the lens into a dashboard. Einstein Analytics will add the lens as a step to currently open dashboards. If there is no dashboard opened, Einstein Analytics will create a new dashboard, then add the lens as a step to the new dashboard created.

When clicking this icon, Einstein Analytics will ask for a label (you can leave it blank, and a default name will be provided in the dashboard), then click Clip to Designer button to apply. Notice that Clip to Designer will not add chart or table widget to the dashboard; you need to drag the step into dashboard designer to have it as a widget in the dashboard. Furthermore, you can change the chart type or formatting in the dashboard (see Figure 5-12).
../images/480970_1_En_5_Chapter/480970_1_En_5_Fig12_HTML.jpg
Figure 5-12

Clip a lens to a new dashboard

Once a lens is clipped to a dashboard, the lens is copied to the dashboard; this means that the step created in the dashboard does not relate to the original lens, and they are completely independent. Any changes to the original lens will not impact to the dashboard, and any changes in the dashboard widget will not impact the lens too. We will discuss dashboard in Chapter 6, so you need not worry about it for now.

Sharing and Downloading Lens

Sharing lens to your team or the whole company is easy, as discussed in Chapter 1; the permission to access the content of an “app” is controlled in the app, including lens and other contents such as dataset and dashboard. So, before sharing a lens, make sure the lens is stored in the app accessible by the users and dataset used for that lens also stored in an app accessible by the users.

Note

You can have lens and dataset stored in the different apps.

Get URL

Instead to manually copy and paste the URL to your colleague, click … icon, then select Share. Click Get URL tab, and you will be presented with two options; open the link in Analytics Tab or Analytics Studio. So, which one should we use? Ideally, if your colleague needs to edit the lens, select URL for Analytics Studio, but if just to explore the lens, select URL for Analytics Tab (see Figure 5-13).
../images/480970_1_En_5_Chapter/480970_1_En_5_Fig13_HTML.jpg
Figure 5-13

Get URL to share a lens

Post to Feed

With this feature, you can easily share the lens to a user chatter feed or a group chatter feed. This will post the chart or table as an image and visible to all users in the group or a user feed. Even for users who do not have Einstein Analytics license, they will be able to see the image posted as a feed.

Download

Probably you have a question on how to download data from the dataset? The answer is that Einstein Analytics does not give options to download data to directly from dataset to Excel or CSV file. But, when you explore the dataset into a table, you can download the dataset into Excel or CSV file; make sure all the fields you want to download are added to the table.

If you notice, I mentioned fields added to the table; this means that you should not use chart lens if would like to download the raw data. Download from chart lens will only give you a summary number based on the chart that has been configured.

Einstein Analytics also gives you the option to download the lens as an image; the image will be in PNG format, similar to the one in Post to Feed.

Tips: If you do not see Download option, check with your Salesforce admin to enable “Download Analytics Data” permission on your Einstein Analytics permission set.

Summary

In this chapter, we discussed everything about lens. Usually, we use lens to explore a dataset, both from dataset and from a widget in dashboard. So far, we have not discussed dashboard, but in the next chapter, we will build a dashboard from scratch.

We learned hands-on how to explore the dataset into a new lens, including both chart mode and table mode, then we shared about saving lens, and clone lens. We also discussed how to explore lens with conversational language, so instead of manually entering fields and grouping, the system will do the job for us; we just need to enter the human-friendly language.

Clip lens to designer offers to copy lens built into an existing dashboard or to a new dashboard; here we also mentioned that lens is not related to a dashboard; anything added to the dashboard will not impact the lens or dashboard anymore; they are completely independent, just sharing the same dataset.

We end the chapter on how to share lens to your team or the whole company; we also can post lens chart or table into someone chatter feed or group feed, and with lens, we are able to download raw data from Einstein Analytics.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.13.76