EDGEANALYTIX, LLC
  • Home
  • SalesForce Solutions
  • Non-Profits
  • Analytics Lab
  • Testimonials
  • About
  • Home
  • SalesForce Solutions
  • Non-Profits
  • Analytics Lab
  • Testimonials
  • About

Analytics Lab:

A blog series distilling QUANTITATIVE data concepts AND USE-CASES IN THE EINSTEIN ANALYTICS PLATFORM.

Lapsed Emails use-case using Einstein Compute Relative Transformation

10/14/2020

0 Comments

 
At first glance, this seems like a trivial use-case. First, contacts that were sent emails in 2018 and 2019 need to be counted.Afterwards all those contacts will be considered 'lasped' if their emails bounced in 2020 or emails not opened in 2020. I had to extract the year because the date field containing email opened and email bounced were in string form so I had to use the len() function since dates can be in xx/xx/2020 or x/x/2020 or x/xx/2020 form.Here is the function substr('Date_Email_Opened',len('Date_Email_Opened') -3,4). Two fields were created-openedYr and bouncedYr. The left part of the snip below represents the raw data with derived fields from above added on right. In addition, 2 compute relative transformations were added to create 'bouncedIn2020' and 'openedIn2020' fields. After dataset creation, it becomes a simple cogroup in SAQL to bring out the different totals 1)# of contacts with emails sent in 2018-19   2)from that list, number of contacts where no emails were sent in 2020 or bounced in 2020.  3) % of lapsed = list2 / list 1

q = load "zds_processedYears";
q_B = filter q by 'OpenedYear' in ["2018", "2019"];
q_C = filter q by 'OpenedYear' in ["2018", "2019"] && ('openedIn2020' == "false" or 'bouncedIn2020' =="true");
result = group q by all full, q_B by all full, q_C by all;
result = foreach result generate count(q) as 'RawData', unique(q_B.'Contact_Id') as 'EmailSent2yrs', unique(q_C.'Contact_Id') as 'SentButNo2020OrBounced2020', unique(q_C.'Contact_Id') / unique(q_B.'Contact_Id')  as 'lapsedPercentage';

Picture
Picture
Picture
Picture
0 Comments



Leave a Reply.

    Author

    Write something about yourself. No need to be fancy, just an overview.

    Archives

    October 2020
    September 2020
    August 2020
    July 2020
    June 2020
    May 2020
    March 2020
    January 2020
    December 2019
    November 2019

    Categories

    All

    RSS Feed

Site powered by Weebly. Managed by Hostwinds