Skip to main content Join the Agentforce Virtual Hackathon to build innovative solutions and compete for a $50k Grand Prize. Sign up now. Terms apply.
I'm stuck on step ⌗2 of Einstein Analytics and Discovery Insights Specialist superbadge.  I'm getting this warning while checking the challenge:

Einstein Analytics and Discovery Insights Specialist - Step 2

The step "Churn Tenure' is in compact form, so the filter values need to be specifed as a minimum and maximum

The static step that feeds has the following the value:

 

"Tenure_Length": {

                "broadcastFacet": false,

                "label": "Tenure Length",

                "selectMode": "single",

                "type": "staticflex",

                "values": [

                    {

                        "display": "High Risk",

                        "value": "1 to 12 months",

                        "min": 1,

                        "max": 12

                    },

                    ...

                ]

            }

I'm using selection binding for min and max values.  The dashboard is correctly filtering:

User-added image

User-added image

Any ideas? 

I've tried a non-compact form step where I inject a saql fragment into the query, as well as where I inject min/max values using a range filter serialization...All these efforts end in the same challenge failure message.

Any help/suggesitions are welcome!
432 answers
  1. Jun 25, 2020, 11:10 AM
    1. Create the Einstein Discovery Story from the model

      • Select Maximize Tenure as story goal, Insight & Predictions as story type
      • Include the following variables in manual mode : Subscription Date, Modem Age, Postal Code, Name, Account Number, Region, Payment Method, Contract, Online Security, Tech Support, Online Backup, Internet Service
    2. Deploy the Prediction

      • Go to the model reated from the story, and select Deploy Model
      • Name the prediction as 'Predicted Tenure'
      • Connect the predictionto the Subscriber Object
      • Leave the mapping as is (All fields should be mapped)
      • Create a new prediction field and name it as 'Predicted Tenure'
      • Ignore Monitor Model Accuracy
      • Select Contract and Payment Method as Action Variables (if you can't see all the variables, zoom out with your browser)
    3. Add Einstein Prediction Lightning Card to Subscriber Record Lightning Page

      • Using the Lightning App Builder, Create a Record Page named 'Default' for the Subscriber Object
      • Choose Clone Salesforce Default Page and select Grouped View Default
      • Drag and drop the Einstein Predictions Lightning Component into the Right Side Panel and choose 'Predicted Tenure'
      • Activate the page and assign it as Org Default for the Desktop
    4. Add Prediction field to Subscriber List View

      • Using Object Manager, set the Field Level Security to 'Visible' for your profile (should be System Admin)
      • Create a new List View and name it 'All Subscribers'
      • Include: Subscriber Name, Predicted Tenure and any other fields you wish to show up and save the list view

    And you should be all set,

    good luck.
  2. Jan 1, 2020, 4:19 PM
    Little did I know when I posted the question that started this thread a little over a year ago that it would serve as a venue to help so many.  Over the past year I have acheived more than I ever expected. I've earned the two Analytics superbadges, passed the Einstein Cerification and was named one of the first Einstein Analytics Champions.  I just wanted to take this opportunity to wish everyone a happy and healthy new year and sincerely hope that all your wishes are met and your goals obtained.
  3. May 6, 2020, 10:11 AM
    Hey Ben,

    1. you actually do not need to define the value column (1 to 12 months, etc.).  All you need are the min and max columns.

    2. for the 'min' column, select '123 number' and label it as 'min'.

    3. do the same for the max column.

    Hey Ben,1. you actually do not need to define the value column (1 to 12 months, etc.). All you need are the min and max columns.2. for the 'min' column, select '123 number' and label it as 'min'.3.

    Then when you are done defining the Tenure Length static, go to your Churn Tenure chart and click on the 'advanced editor'; then select 'query'.

    here, you will have to bind your toggle selection (Tenure Length) to your Churn Tenure chart,

    You bind it by changing this:

    "query": "q = load \"Beattie_Subs\";\nq = filter q by 'Tenure' >= 0 && 'Tenure' <= 100;\nq_B = filter q by 'Churn' == \"Yes\";\nresult = group q by all full, q_B by all;\nresult = foreach result generate (count(q_B) / count(q))*100 as 'churnRate';\n",

    to this:

    "query": "q = load \"Beattie_Subs\";\nq = filter q by {{row(Tenure_Length_1.selection,[0],[\"min\",\"max\"]).asRange (\"Tenure\")}};\nq_B = filter q by 'Churn' == \"Yes\";\nresult = group q by all full, q_B by all;\nresult = foreach result generate (count(q_B) / count(q))*100 as 'churnRate';\n",

    Let me know if you got it.
  4. Dec 2, 2019, 8:14 PM
    A few thoughts, first off this thread is very helpful.. but I don't think the majority of users on here are not approaching this challenge from the perspective of a SF consultant, but rather looking to complete the challenges programmatically like a developer of SQL expert.

    This creates a ton of confusion for people looking for guidance on how to create dashboards intuitively without deep SAQL or SQL backgrounds.  

    For example:

     Step 1 in the superbadge is a challenge that seems to be all about understanding the windowing SAQL functions used to create the chart that creates a few of the subscriber activity. I was barely able to understand how to create this dataset from the responses on here, but eventually I got it. E.g. Some people are calling "Current quarter cancellations" as "New Quarter Cancellations" whihc is not how it is described in teh activity and in general the problem for me comes from the way people use developer lingo to describe their solutions and no one seems to comment their code which is really confusing to me. 

    q = load "Beattie_Subs";

    -- Current Quarter Cancellations

    cancelled = group q by ('Churn_Date_Year', 'Churn_Date_Quarter');

    cancelled = foreach cancelled generate cancelled.'Churn_Date_Year' + "~~~" + cancelled.'Churn_Date_Quarter' as 'ActivityDate_Year~~~ActivityDate_Quarter', count() as 'Current Quarter Cancellations';

    -- New Quarter Subscribers

    subs = group q by ('Subscription_Date_Year', 'Subscription_Date_Quarter');

    subs = foreach subs generate subs.'Subscription_Date_Year' + "~~~" + subs.'Subscription_Date_Quarter' as 'ActivityDate_Year~~~ActivityDate_Quarter', count() as 'New Quarter Subcribers';

    -- Previous Quarter Subscribers

    subs = group subs by ('ActivityDate_Year~~~ActivityDate_Quarter');

    subs = foreach subs generate subs.'ActivityDate_Year~~~ActivityDate_Quarter' as 'ActivityDate_Year~~~ActivityDate_Quarter', coalesce(sum(subs.'New Quarter Subcribers'),0) as 'New Quarter Subcribers', coalesce(sum(sum('New Quarter Subcribers')) over ([-1..-1] partition by all order by ('ActivityDate_Year~~~ActivityDate_Quarter')),0) as 'Previous Quarter Subcribers';

    -- Previous Quarter Cancellations

    cancelled = group cancelled by ('ActivityDate_Year~~~ActivityDate_Quarter');

    cancelled = foreach cancelled generate cancelled.'ActivityDate_Year~~~ActivityDate_Quarter' as 'ActivityDate_Year~~~ActivityDate_Quarter', coalesce(sum(cancelled.'Current Quarter Cancellations'),0) as 'Current Quarter Cancellations', coalesce(sum(sum('Current Quarter Cancellations')) over ([-1..-1] partition by all order by ('ActivityDate_Year~~~ActivityDate_Quarter')),0) as 'Previous Quarter Cancellations';

    -- Churn Rate is Current Quarter Cancellations / (New Quarter Subscribers + Previous Quarter Subscribers - Previous Quarter Cancellations)

    resultchurn = cogroup subs by 'ActivityDate_Year~~~ActivityDate_Quarter' full, cancelled by 'ActivityDate_Year~~~ActivityDate_Quarter';

    resultchurn = foreach resultchurn generate coalesce(subs.'ActivityDate_Year~~~ActivityDate_Quarter', cancelled.'ActivityDate_Year~~~ActivityDate_Quarter') as 'ActivityDate_Year~~~ActivityDate_Quarter', sum(cancelled.'Current Quarter Cancellations')/(sum(subs.'New Quarter Subcribers') + sum(subs.'Previous Quarter Subcribers') - sum(cancelled.'Previous Quarter Cancellations')) as 'Churn Rate';

    Now I am definitely stuck on Step 2 and I would like to know how the Dashboard tools are intended to be used, not how you can use SAQL and JSON to force the solutions into the validation checker to complete the step.  

    Here’s my question: 

    Using the toggle from the Dashboard tools, how exactly does one define a custom query with user defined values (which is also called a static step I think) 

    It would seem that you define the filters like this 

    A few thoughts, first off this thread is very helpful..

    Note:  

    I have researched this topic and there’s very little guidance on trailblazer community KB for this Create a Custom Query with User-Defined Values (https://help.salesforce.com/articleView?id=bi_dashboard_steps_custom_flex.htm&type=5) its also very poorly described in the developer bindings guide on page 35   (https://resources.docs.salesforce.com/222/latest/en-us/sfdc/pdf/bi_dev_guide_bindings.pdf

    With that said I hope someone can help this non developer understand how to use these great tools.
  5. Apr 15, 2019, 1:09 AM
    Hi Sandeep,

    I am not sure what step did you wrong, please check these.

    In my case my step name is Attrition_Cost_1

    [Attrition Cost]

    q = load "Beattie_Subs";

    q = filter q by 'Tenure' in all;

    result = filter q by 'Churn' == "Yes";

    result = group result by all;

    result = foreach result generate count() as 'count', count()*950 as attrCost;

    result = limit result 2000;

    Hi Sandeep,I am not sure what step did you wrong, please check these.

    [Reference Line]

    "referenceLines": [

        {

            "color": "⌗E84340",

            "label": "{{cell(Attrition_Cost_1.result, 0, \"attrCost\").asString()}}",

            "value": "{{cell(Attrition_Cost_1.result, 0, \"attrCost\").asString()}}"

        }

    ],

    User-added image

    Congrats :)

    LinThaw
  6. Dec 24, 2018, 4:12 PM
    Hi Mitesh,

    Happy holidays from NYC!  In quasi-code, I did step one like this:

    1. Load the dataset into q
    2. filter q into a new stream (cancellations) by Churn (you want the number of cancellations, so set the churn bit appropriately)
    3. Group cancellations by ChurnDate year/quarter but project the date as ActivityDate year/quarter; count() as current quarter cancellations, 
    4. you then need to lag cancellations by one period, so generate again but this time collect 'cancellations' by sum and in a separate column, include a window function with sum to pick up the prior period.  I won't tell you have to do it, but read up on windowing
    5. group q by Subscription_Date  year/quarter
    6. generate a count() for "subscribers" and like above, project subscription_date year/quarter as ActiviityDate year/quarter.
    7. re-generate the stream from step 6 as a sum of "subscribers" and add lagged subscribers by the same windowing sum that you did for cancelllations.
    8. then you can either cogroup with a full join on ActivityDate year/quarter (and then generate the formula you need) or union and regroup by ActivityDate year/quarter.

    Remember that the formula for churn in this step is current quarter cancellations/(current subscribers + subscribers from a quarter ago - cancellations from a quarter below)

    Its super tricky but concentrate on 1) windowing to get the proper lag and 2) joining the streams to get your formula constituent parts.

    Hope this helps!

    Regards,

    Peter
  7. Jun 25, 2020, 12:14 PM
    That's more of a twisted logic than a challenge or learning. Sometimes you achieve the results required by the challenge, but Trailhead expect something else from you, and you spend hours and days figuring out the problem whitout a clue in the error message, so i believe this is a waste of time and an unnecessary frustration. I didn't share the solution where the instructions are perfectly clear in the challenge, but where they aren't i prefere to save people's time and energy for more productive tasks.

    Cheers.
  8. May 7, 2020, 12:07 PM
    1. You need to create a Subscriber Revenue Query.

    2. Then push the Subscriber Revenue Query onto the dashboard as a horizontal bar chart.

    3. Then you need to create another Query called Attrition Cost

    q = load "Beattie_Subs";

    q = filter q by 'Tenure' >= 0 && 'Tenure' <= 100;

    result = filter q by 'Churn' == "Yes";

    result = group result by all;

    result = foreach result generate count() as 'count', count()*950 as attrCost;

    result = limit result 2000;

    4. click on your Subscriber Revenue Chart, while you're under "WIDGET", go down till you see X-Axis (Top). Here you will add the Reference Line. like this below. When you add the reference line label, make sure to select 'attrcost' so that the numbers show up in the reference line.

    1. You need to create a Subscriber Revenue Query.2. Then push the Subscriber Revenue Query onto the dashboard as a horizontal bar chart.3.

    User-added image

    5. then click on an empty spot in your dashboard. go to to Attribution Cost on the right hand bar. Click on the down arrow of Attribution Cost, click on Properties. Then click on advanced editor.  To bind your toggle to the Attribution Cost, you will need to revise the JSON that you see for your Attribution Cost. Change the filter by to (see what's bolded below):

    "query": "q = load \"Beattie_Subs1\";\r\nq = filter by {{row(Tenure_Length_1.selection,[0],[\"min\",\"max\"]).asRange (\"Tenure\")}};\r\nresult = filter q by 'Churn' == \"Yes\";\r\nresult = group result by all;\r\nresult = foreach result generate count() as 'count', count()*950 as attrCost;\r\nresult = limit result 2000;",

    Click on thumbs up please if this works for you. It should work.
  9. Mar 1, 2019, 3:26 PM
    Thanks to LinThaw, I was able to pass this using :

     

    filter q by {{row(Tenure_Length_1.selection, [0], [\"min\",\"max\"]).asRange(\"Tenure\")}};

    as a filter to query in Attrition Cost SAQL.

    Thanks a lot LinThaw !
  10. Oct 14, 2020, 6:51 PM
    Challenge 5 indeed is a little vexing ... the set of Fields that worked for me in manual mode when setting up the story are:

    Subscription Date, Modem Age, Postal Code, Region, Payment Method, Contract, Online Security, Tech Support, Online Backup, Internet Service

    A prior list that did not pass the trail check (see error message below) is:

    Subscription Date, Modem Age, Postal Code, Region, Payment Method, Contract

    To that end, the below error message is very generic and the emphasis in this csae is on simply "... Check the model fields" and not so much about "... fields that may cause data leakage ...

    "We can't confirm you mapped the correct fields on the Tenure model. Check the model fields, make sure to avoid using fields that may cause data leakage, and try again."
0/9000