Pages

Friday, January 18, 2019

Einstein Analytics: Understanding Nodes in Monitor

1. CSV File Load
When we create a new dataset using CSV file, here are the items in the Monitor:


Let's understand each item and the Node Type, data flow title sample_data_4 Upload flow - Overwrite:
- sample_data_4 is the dataset name, not CSV file name;
- Upload flow - Overwrite suffix is always the same for all CSV load.

Nodes involved for CSV data load:
  • sfdcFetch
  • csvDigest
  • optimizer
  • sfdcRegister

When we replace dataset with a new CSV file, the title and nodes in Monitor will stay the same.


2A. Simple data fetch from Salesforce
Here we have a simple dataflow with 2 nodes: sfdcDigest and sfdcRegister.

Items in the Monitor:



The title is Dataflow name, and nodes involve in Monitor for this dataflow:
  • sfdcDigest
  • optimizer
  • sfdcRegister

What happened if we add filter conditions to the sfdcDigest node? Will it change the nodes in the monitor? The answer is No, because the filter happens inside sfdcDigest node only.

optimizer is always run before sfdcRegister for each sfdcRegister mode.


2B. Adding augment nodes to Dataflow




Here are nodes in the Monitor:


From the above screenshot, we have another sfdcDigest node for getUser, and augment node.


2C. Adding sliceDataset and filter nodes to Dataflow



Here are nodes in the Monitor:


Now we have addition nodes: sliceDataset and filter as per order in the data flow.


2D. Add edgemart and computeExpression nodes to Dataflow


Here are nodes in the Monitor:


Edgemart note start first and computeExpression node is run after augmentAccount_User, so this order as per dataflow. From the screenshot edgemart and computeExpression also run sliceDataset node with name DropSharingRulesFrom-, further check, this DropSharingRulesFrom- is randomly added, it can be appeared for sfdcDigest or augment node too, I am still checking what is the caused.


3. Trend Salesforce Report
Next, let us see how Trend from Salesforce report to Einstein Analytics. When you setup Trend for the first time from Salesforce report, it will run once to create dataset and dashboard, this activity happens before the scheduled date/time.

Sample from Monitor:


There are only 3 nodes here:
  • sfdcFetchReport
  • optimizer
  • sfdcRegister

But, when the scheduler running, this is the nodes:



Let us see each node:
  • edgemart - to read existing dataset
  • sfdcFetchReport - to get data from Salesforce
  • let us ignore DropSharingRulesFrom
  • append - to add existing dataset data read from edgemart, with new data from sfdcFetchReport
  • optimize and register by overwrite the dataset


4. Recipe with Append

This is a simple recipe to add a dataset to another dataset and produce new dataset.



When we run the recipe, here are nodes in the Monitor:




Let us see each node:
  • edgemart from append (new) table and edgemart from root (based) table
  • let us ignore DropSharingRulesFrom
  • two computeExpression nodes
  • append transformation node
  • slideDataset transformation node
  • optimizer and sfdcRegister nodes



Sunday, January 13, 2019

Einstein Analytics: Using SOQL

So far, we all know, in building dashboards in Einstein Analytics, we need to bring the data into Einstein Analytics and stored it as Dataset. In this blog, I will share how to directly get data from Salesforce using SOQL, this means we can create a chart wizard or table in  Einstein Analytics with Salesforce live data.

You need to know the basic JSON dashboard in Einstein Analytics. After you create the dashboard, create a step with the type = soql, e.g.
 "soql_step_name": {  
  "type": "soql",  
  "query": "SELECT Name from ACCOUNT",  
  "strings": ["Name"],  
  "numbers": [],  
  "groups": [],  
  "selectMode": "single"  
 }  

Once the step added, you can use it in any wizard. The isFacet and useGlobal properties don't apply to this step type. You can use a binding to filter other steps based on a selection in a soql step.

Let's see more samples:
 "soql1": {  
         "type": "soql",  
         "query": "SELECT Id,Name,NumberOfEmployees,Type from ACCOUNT",  
         "strings": [  
           "Type",  
           "Id",  
           "Name"  
         ],  
         "numbers": [  
           "NumberOfEmployees"  
         ],  
         "groups": [],  
         "selectMode": "single"  
       }  
 "soql2": {  
         "groups": [],  
         "numbers": [  
           "foo"  
         ],  
         "query": "SELECT count(id) foo from ACCOUNT",  
         "selectMode": "single",  
         "strings": [],  
         "type": "soql"  
       }  
 "soql3": {  
         "groups": [],  
         "numbers": [],  
         "query": "SELECT Id,Name from USER where Id = '{!User.Id}'" ,  
         "selectMode": "single",  
         "strings": ["Id","Name"],  
         "type": "soql"  
       }  
  "soql4": {  
         "type": "soql",  
         "query": "SELECT NumberOfEmployees,Name,Type from ACCOUNT",  
         "strings": [  
           "Type",  
           "Name"  
         ],  
         "numbers": [  
           "NumberOfEmployees"  
         ],  
         "groups": [  
           "Type"  
         ],  
         "selectMode": "single"  
       }  

Notes:
- same as the normal step in JSON, the order of parameters will be ignored
- type parameter is "soql"
- query parameter must be valid soql and contain all fields needed
- fields from query result should be put under strings or numbers parameter
- groups parameter is optional, but needed when you have grouping in the wizard


Here is the wizard result from each step above:

step soql1


step soql2


step soql4

Use SOQL result for binding
 "soql1": {  
         "groups": [],  
         "numbers": [  
           "NumberOfEmployees"  
         ],  
         "query": "SELECT Id,Name,NumberOfEmployees,Type from ACCOUNT order by NumberOfEmployees",  
         "selectMode": "single",  
         "strings": [  
           "Type",  
           "Id",  
           "Name"  
         ],  
         "type": "soql"  
       }  

 "all_1": {  
         "type": "saql",  
         "query": "q = load \"All_Accounts\";\nq = group q by all;\nq = foreach q generate {{cell(soql1.result,1,\"NumberOfEmployees\").asObject()}} as 'name1';\n",  
         "useGlobal": true,  
         "numbers": [],  
         "groups": [],  
         "strings": [],  
         "visualizationParameters": {...},  
         "label": "all_1",  
         "selectMode": "single",  
         "broadcastFacet": true,  
         "receiveFacet": true  
       },  

result:
* 18 is the result from the second row cell(soql1.result,1,\"NumberOfEmployees\").asObject()



Reference:


Analytics on Einstein Activity Capture using Einstein Analytics

As per this article Guidelines for Capturing Email and Events with Einstein Activity Capture, Einstein Activity Capture aren’t stored in Salesforce, so they don’t show up in standard or custom Salesforce reports. However, Einstein Activity Capture provides access to the Activities dashboard, which is built on Einstein Analytics. The Activities dashboard summarizes sales activities, including activities added with Einstein Activity Capture. This only available for Enterprise, Performance, and Unlimited Editions.



After Einstein Activity Capture is enabled, the Activities dashboard is created. If you don’t see the dashboard after 24 hours, go to the Einstein Activity Capture setting page. Turn off Einstein Activity Capture, and then turn it on again. A dataflow named Activities will be created in Einstein Analytics together with Activities dashboard, check and make sure it is scheduled.



Once the dataflow runs, it will create a dataset called Activities.



The activity data that users see in the Activities dashboard depends on whether you use role hierarchy. If you use role hierarchy, users see data for only activities that they’re involved with and that users below them in the role hierarchy own. If you don’t use role hierarchy, users see data for all activities in the dataset.

The Activities dashboard in Einstein Analytics provides a summary of sales activities that were added to Salesforce manually and by Einstein Activity Capture. By looking at Activities dashboard, we can't really differentiate or filter only activities related to Einstein Activity Capture, so let us dig further.

Here the step to filter only Einstein Activity Capture data from Activities dataset:
1. Open Activities dataset and this will create a new Lens
2. Change the Lens mode from chart to values Table mode
3. Filter by Source Id where IS NOT Equal to "core:events" and "core:tasks"



Few fields to take note from this table:
- Activity Type: the activity is Email or Event
- Account Id, Account Name: if the activity tagged to an Account
- Related Id, Related Type, Related Record: if the activity related to a specific object
- Person Id, Person Type, Customer: the person tagged to the activity
- User Id, User: internal user owned that activity


Reference:

Wednesday, January 9, 2019

Einstein Analytics: Using Salesforce Report Trend with Dataflow

If you are new with Einstein Analytics, probably you will shock that not all objects can be retrieved from Salesforce to Einstein Analytics platform, even the objects are supported by SOQL, check out this article for objects are not supported. On top of that, there is also known issues when retrieving Salesforce supported objects, such as here and here.

Furthermore, there are Salesforce report only fields, these fields are not available in the object, such as Last Stage Change Date, Stage Duration, Is Split in Opportunity report, Last Activity, Unread by Owner in Lead and many more.

How we can bring this information from Salesforce to Einstein Analytics? The answer is using Trend. But, as you know, trend will keep adding data to the dataset, while the requirement here is to have the exact number of rows between Salesforce with Einstein Analytics.

Solution: let us build a dataflow to manipulate the dataset produced by the trend.

1. Trend Salesforce Report
There is nothing fancy here, just open the report and click Trend button, you need to specify the Dataset name, Dashboard title, Schedule Frequency, Days, and Time. Once you click the Trend button, the system will run this in the next few minutes so you can see the dataset and dashboard created in Einstein Analytics.

2. Open Dataset
Edit dataset created by Trend, and take note the dataset API name.



3. Create Dataflow
Here is the logic of dataflow:
a). Read Dataset created by Trend, e.g. Dataset-Source

b). Get other objects from Salesforce as necessary, and augment with Dataset-Source, you can do all the data manipulation here.

c). Register the data as a new dataset, e.g. Dataset-Target

d). Clean Dataset-Source, you can use Filter transformation using filter where the result would be blank.

e). Register clean data where Alias = dataset API name from step 2 above, and Name equal to Dataset Name. This step with the alias and name is very important, this will make sure to overwrite trend data with blank data.


f). Schedule the dataflow, make sure it only runs after Trend schedule, to be safe, you can make a 1-hour difference between the schedule.


A sample of a dataflow using this solution:




Reference:



Monday, January 7, 2019

Salesforce: Share Multiple Files in a Folder Using Public Links

In Winter '19, Salesforce introduces a new feature for the ability to share files in a folder to the public. Here is the article Share Multiple Files in a Folder Using Public Links. This feature is available only in Lightning.

This is pretty similar to Content Deliveries in classic, but public links let you share documents easily via links, but without password protection, expiration, or usage tracking.

Here are a few things you need to check to enable this:

1. Content Deliveries and Public Links
Make sure you see this menu in setup page, otherwise reach out to Salesforce support to enable it.



Once you in Content Deliveries and Public Links, enable this "Public Links can be enabled for users (Requires Content Deliveries)".

As you see from above this also requires Content Delivery.


2. Content Permissions
Search for Content Permissions under setup menu (until Spring '19 release - this only available in Classic, so you need to switch back to Classic). This will allow you to add, edit, and delete Library Permissions - a Library Permission is a set of user privileges for Salesforce CRM Content libraries.

Click Edit on Library Permission Name and enable Deliver Content.


If you do not see Deliver Content action, reach out to Salesforce support to enable it.


3. Create Library (optional)
This step only needed if you need to create a new library, make sure you have the appropriate permission to create Library.



4. Create Folder
Once you are in the library, click New Folder button to create a folder.




5. Create Public Link
Without correct setup and appropriate permission, the user will not able to click a public link for sharing.



Once all setup correctly, you will see Public Link option from the drop-down menu for the folder.


Note: if you delete and recreate the public link, the URL will be changed.

Once you uploaded files, here is the final result, the content accessed from the public link will be updated in real-time.



If you see a blank screen when open the public link, there is a known issue which will be fixed in Spring 19 release <-- update this has been fixed in Spring 19 release.



ReferenceShare Multiple Files in a Folder Using Public Links




Wednesday, January 2, 2019

SimplySfdc in 2018


Happy New Year 2019! Again this time, it is an exciting moment to share some statistic of my blog SimplySfdc - a blog dedicated to all Salesforce users and community around the world - in 2018.

In 2018, I wrote more blog compare to 2017 (more than 85% blog), total pageview and total session increase accordingly.

Page 2018 2017 2016 change*
Total New Page 63 34 76 85.29%
Total Pageviews 171,249 115,744 161,516 47.95%
Total Sessions 149,574 97,310 130,724 53.71%
Pages / Session 1.14 1.19 1.24 -3.74%
*compare 2018 to 2017


Similar with previous years, organic search always contributes the largest portion of traffic source in 2018, and this year it increased by 2%. Direct traffic growth for 2.5%, this is a good sign that simplysfdc.com blog has become more trusted and followed by more people. Both referral and social channel lower in 2018.

Channel Source 2018 2017 2016
1. Organic Search 69.63% 67.66% 78.79%
2. Direct 27.15% 25.64% 12.68%
3. Referral 1.76% 4.09% 3.34%
4. Social  1.46% 2.60% 5.19%


Google, as we know, is the king of search engine for many years, the same applies for simplysfdc.com blog in 2018, it contributes more than 97% of traffic, which is 1% increase compared to 2017. Bing and Yahoo stay at the 2nd and 3rd spot in a very far distance, and both search engine contribution as search engine decrease in 2018 compared to 2017, would this mean anything in the search engine war globally?

Top Search Engine 2018 2017 2016
1. Google 97.48% 96.46% 97.29%
2. Bing 2.02% 2.66% 1.90%
3. Yahoo 0.47% 0.77% 0.70%
4. Other 0.03% 0.11% 0.11%


A huge change in the social media landscape in 2018 for the traffic contribution for simplysfdc.com. Twitter contribute more than half of the traffic from social media - this is aligned as Twitter is the most prominent social media among Salesforce #Ohana. While LinkedIn contribution drops to 15% only.

Top Social Media Source 2018 2017 2016
1. Twitter (#2 in 2017) 56.50% 26.42% 29.07%
2. Facebook (#3 in 2017) 18.00% 7.15% 4.45%
3. LinkedIn (#1 in 2017) 15.65% 44.81% 21.77%
4. Blogger (#5 in 2017) 4.17% 4.61% n/a 
5. Google+ (#4 in 2017) 2.30% 7.11% 11.43%


There is no change in the top 6 countries of the visitors, however, US visitors drop for more than 7.5% of the total number of visitors. All other countries contribute more visitors in term of percentage of the visitors. Top six countries represent more than 79 % of blog visitors.

Top Visitor Country 2018 2017 2016
1. United States 41.84% 49.45% 49.04%
2. India 23.88% 19.56% 20.41%
3. United Kingdom  4.95% 4.61% 4.88%
4. Australia 3.30% 2.58% 2.17%
5. Canada 2.92% 2.38% 2.12%
6. France  2.18% 1.90% 1.87%


From cities perspective, all 6 cities from 2017 still appear in 2018, but New York and San Francisco drop to #5 and #6 with lower percentage compare to 2017. Top 6 cities represent almost 19% of the total visitors.

Top Visitor City 2018 2017 2016
1. Bengaluru 6.08% 5.24% 5.74%
2. Hyderabad 3.76% 3.76% 3.51%
3. London  (#5 in 2017) 2.50% 2.37% 2.57%
4. Pune  (#6 in 2017) 2.32% 1.97% 2.00%
5. New York (#4 in 2017) 2.30% 2.80% 2.98%
6. San Francisco (#3 in 2017) 1.89% 3.02% 3.39%


This statistic includes access from desktop and mobile. Total top 5 web browsers contribute more than 98% of the visitors. For an unknown reason, Internet Explorer takes over Firefox and Safari as #2. Chrome becomes more and more popular among web browser used by visitors.

Top Visitor Web Browser 2018 2017 2016
1. Chrome 83.34% 81.33% 78.88%
2. Internet Explorer (#4 in 2017) 5.43% 4.65% 4.46%
3. Firefox (#2 in 2017) 4.64% 6.36% 8.37%
4. Safari (#3 in 2017) 3.28% 5.32% 6.80%
5. Edge 1.71% 1.11% 0.64%


In terms of operating system, there is no change in the top 5 web browsers, however, Android users take over iOS from #4 to #3. Windows user users increase by almost 2%. Total access from mobile only 5.42% of the total of visitors, down from 6.53% in 2017, while table users stable at 0.70% in 2017 and 0.79% in 2018. This makes sense because most of the visitors access this blog when they have difficulty in configuring Salesforce using the desktop/laptop.

Top Visitor Operating System 2018 2017 2016
1. Windows 75.13% 73.36% 73.78%
2. Macintosh 17.12% 17.93% 17.04%
3. Android (#4 in 2017) 3.15% 2.63% 2.18%
4. iOS (#3 in 2017) 2.80% 4.10% 5.26%
5. Linux 1.36% 1.23% 1.23%


In screen resolution, 1536x864 appears as a new resolution at spot #3, however, actually this is 1920x1080 resolution with the display setting 125% zoom. So in total, 1920x1080 contribute more than 30%, which is 10% above older laptop screen resolution 1366x768. 1920x1080 found in high-end laptop and LCD monitor. 1280x720 now raise one spot, this resolution mostly found at the middle-end tablet or mobile phone.

Top Visitor Screen Resolution 2018 2017 2016
1. 1920x1080 21.87% 20.87% 22.46%
2. 1366x768 20.09% 21.63% 26.81%
3. 1536x864 (new) 8.53% 8.12% n/a
4. 1440x900 (#3 in 2017) 8.23% 8.44% 8.94%
5. 1280x720 6.63% 4.63% 2.21%
6. 1600x900 (#4 in 2017) 4.20% 5.92% 8.22%


Top 5 Popular Page
For popular pages, 3 of 5 top pages from 2017 still stay in 2018.
SOQL query LAST_WEEK ; LAST_N_DAYS:n ; N_DAYS_AGO:n (#4~2017; #2~2016; #1~2015; #6~2014) drop to #7 in 2018.
Salesforce: Data Loader Time Zone (#5~2017; #8~2016; #13~2015) drop to #13 in 2018.
A new blog about Mass Action in the Lightning post in early 2018 gain popularity to #4.

1. Salesforce: How to export Attachments? (#1~2017; #4~2016; #4~2015; #5~2014)
2. Salesforce: ISBLANK() or ISNULL() (#3~2017; #1~2016; #2~2015; #3~2014)


Top 5 Referral Site
1. Salesforce Ben ~ Ultimate Salesforce Blogs List
2. SrinuSFDC ~ Admin 201 Sample Questions 1 - 20
3. Salesforce Ben ~ May Round Up of the Top Blog Posts!
4. Salesforce Ben ~ June Round Up of the Top Blog Posts!
5. Salesforce Ben ~ February Round Up of the Top Blog Posts!


Sub Blog
I also have 3 sub-blog, where the traffic is not part of the statistic listed above:


Reference: