function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Brian KesslerBrian Kessler 

Einstein Analytics and Discovery Insights Specialist Challenge 3: How do I calculate subscriber attrition cost?

I am presently stuck on Einstein Analytics and Discovery Insights Specialist Superbadge (https://trailhead.salesforce.com/en/content/learn/superbadges/superbadge_analytics_insights_specialist) Challenge #3

The dashboard designer tells me there is an error in my Attrition Cost step
 
Warning! 
Analytics encountered a problem with this step [Attrition_Cost_1]. 
Input stream not found

My SAQL query is this:
beattieSubscribers = load "Beattie_Subs"; tenuredSubscribers = filter beattieSubscribers by{{row(Tenure_Length_1.selection,[0],["min","max"]).asRange ("Tenure")}}; churnedSubscribers = filter tenuredSubscribers by 'Churn' == "Yes"; attrCost = churnedSubscribers * 950.00;


What am I missing?
 
Best Answer chosen by Brian Kessler
Brian KesslerBrian Kessler
After much struggle and no help, I finally figured it out:

1. After filtering the beattieSubscribers for Tenure and Churn, I need to group these.
 
groupedSubscribers = group tenuredSubscribers by all full, churnedSubscribers by all;

and then,

2. I needed to generate the attrition cost for each subscriber in the group, and assign the value using "as" syntax, instead of just equals:
 
attrCost = foreach groupedSubscribers generate count(churnedSubscribers)*950 as 'attrCost';





 

All Answers

Brian KesslerBrian Kessler
I am still stuck here... some more info if it helps anyone to help me:

I have the above SAQL query as the query in the "Attrition_Cost__1" step, which at length looks like this:
 
"Attrition_Cost_1": {
                "broadcastFacet": true,
                "groups": [],
                "label": "Attrition Cost",
                "numbers": [],
                "query": "beattieSubscribers = load \"Beattie_Subs\";\r\ntenuredSubscribers = filter beattieSubscribers by{{row(Tenure_Length_1.selection,[0],[\"min\",\"max\"]).asRange (\"Tenure\")}};\r\nchurnedSubscribers = filter tenuredSubscribers by 'Churn' == \"Yes\";attrCost = churnedSubscribers * 950.00;\r\n",
                "receiveFacet": true,
                "selectMode": "single",
                "strings": [],
                "type": "saql",
                "useGlobal": true
            },

However in the Dashboard Designer, on the right, under "Steps with Errors" I see:
 
Attrition Cost
Attrition_Cost_1

If I click "View Error", I see:
 
Warning!
Analytics encountered a problem with this step [Attrition_Cost_1].
Input stream not found

FWIW, if I check the challenge -- which I wouldn't actually expect to pass right now -- I get the following error:
 
Challenge Not yet complete... here's what's wrong: 
We can't confirm the chart reference lines have the correct label and value. The reference line has to have attrition costs as its label and value, plus filter by the Tenure Length toggle.

Can anyone kindly explain what this error means and an appropriate fix?
 
Brian KesslerBrian Kessler
After much struggle and no help, I finally figured it out:

1. After filtering the beattieSubscribers for Tenure and Churn, I need to group these.
 
groupedSubscribers = group tenuredSubscribers by all full, churnedSubscribers by all;

and then,

2. I needed to generate the attrition cost for each subscriber in the group, and assign the value using "as" syntax, instead of just equals:
 
attrCost = foreach groupedSubscribers generate count(churnedSubscribers)*950 as 'attrCost';





 
This was selected as the best answer
Nikhil Nag 5Nikhil Nag 5
Hi
This error occurs due to two of the below reasons:
1. Either you have not referenced Attrition Cost with your Reference Line.
2. Or you have not bind your filtered your Reference Line with Tenure Length.

Please check whether you have achieved these steps:
1. Create Attrition Cost query and bind it with Tenure length toggle.
2. Create Subscription Cost query. Create a Referece Line on this chart and choose Attrition Cost query for its Label and Value. You don't need any filter on this Referene Line on the basis of Tenure Length.
Make sure these two steps are achieved and you should be able to pass this challenge.

Mark it as Best Answer if it is helpful for you.
Stephanie EbertStephanie Ebert
For anyone who might be reading through these older posts having a similar issue.  Binding the Attrition Cost query with the Tenure length toggle was the trickiest part for me.  I was looking for the Advanced Interaction Editor to build the binding syntax for my query.  I realized the syntax was identical to that of the previous challenge, so after copying/pasting into the query editor for Attrition Cost, it was finally accepted.  I did also need to update the name of the field being referenced as the label was still '[B]' in the reference line.