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.
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
Run App
Share App
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
Bar chart.
Bar length is the count of rows.
No grouping.
No filters.
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.
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.
Using Table in Lens
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.
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.
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.
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
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.
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
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.
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
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.