+ Start a Discussion
Peter Greenbaum 7Peter Greenbaum 7 

Einstein Analytics and Discovery Insights Specialist - Step 2

I'm stuck on step #2 of Einstein Analytics and Discovery Insights Specialist superbadge.  I'm getting this warning while checking the challenge:
Challenge #2 Not complete
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!
Mitesh TrailblazerMitesh Trailblazer
Hi Peter,
I assume that you completed the Step one of the challenge to reach here and I am stuck at the Step 1 to create the Churn Rate field. Not able to turn my head around with all the known information specially for the quarters where there are no subscription but only cancellation like 2016 -4 and 2017-4 Can you please help with the approach you have taken? 
Regards
Mitesh 
Peter Greenbaum 7Peter Greenbaum 7
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
Mitesh TrailblazerMitesh Trailblazer
Hi Peter,

Thanks for the detailed elaboration as the pseudo code and wishing you and your family merry christmas and Happy New Year. Will give the approach you suggested a shot and progress with my challenge :-)

Happy holidays 
Regards
Mitesh 
Mitesh TrailblazerMitesh Trailblazer
Hi Peter 
Hope you have made good progress on the Challenge and Super badge. I am on the final step and not able to go past the step with error 

Challenge Not yet complete... here's what's wrong: 
We couldn’t find the correct information associated with Apex trigger named SetDealPrediction. Confirm the Salesforce object and integration name
My Trigger works absolutely fine and the Custom setting name is also 'Tenure'
Can you please help.

Regards
Mitesh
Peter Greenbaum 7Peter Greenbaum 7
I'm not here yet.  Haven't been able to get off of step two.  Did you filter tenure before you generated the cancellation stream, so both streams (subscribers & cancellations) had the filter or after so only one or the other was filtered?  What kind of binding did you use (straight saql, or a range serialization)?
Mitesh TrailblazerMitesh Trailblazer
Hi Peter,
Just finished this Superbadge. For Step two you can try following steps:
a) Get the Toggle widget to be bound with Static step
b) For the Value of Static step kindly use range and we will use range serialixation later for the binding purpose. Eg below
 "display": "High Risk",
                        "value": "1 to 12 months",
                        "min": 1,
                        "max": 12
c) Filter first stream by binded results and another stream by Churn(Cancelation stream per your teminology) (remeber we have to provide the ratio of Churned to Subscribed.
d) The you can do group by all full

Hope it helps.

Regards
Mitesh 
 
Peter Greenbaum 7Peter Greenbaum 7
Thanks.  Still failing for the same reason.  I used your approach in terms of structuring the Tenure_Length step (display= label, value = range text, min and max scalars -- as you indicated above). My Churn_Tenure step query value is:
q = load \"Beattie_Subs\";\n
q = filter q by {{row(Tenure_Length.selection, [0], [\"min\",\"max\"]).asRange(\"Tenure\")}};\n
q_B = filter q by 'Churn' == \"Yes\";\n
result = group q by all full, q_B by all;\n
result = foreach result generate (count(q_B)/ count(q))*100 as 'churnRate';
Further, the numbers actually make sense (High Risk has a larger churn rate than Medium and Low risk).  Stumped!
 
cheryl bunch 11cheryl bunch 11
@Peter Greenbaum 7 I could not have done Step 1 without your posting this step-by-step. Much more help than the activity itself! Thanks!
Peter Greenbaum 7Peter Greenbaum 7
I'm happy to have helped.  Still stuck on step two.  I know that I'm doing everything right because the numbers change (and make sense) when the risk level changes but it still fails me.  Can you let me know when you passed #2?
cheryl bunch 11cheryl bunch 11
@Peter, I will be going to Step 2 tomorrow so will let you know if I make progress on it. I am pretty slow - too many years out of hands on! :)
Mitesh TrailblazerMitesh Trailblazer
Hello Peter-

If thats the case and you have all the steps for Challenge # 2 complete I advice you to please check the order/sequencing of the tasks to accomplish challenge # 2 and others as well. My observation was that the app and the Churn rate or any other bindings if registered wrongly the first time will cause issue in the verification. I reached to partner support collaboration group as well for these issues and below if the link.

Feel free to reach to me for any assistance and I will be happy to help you folks.

Regards
Mitesh 
rv8rv8
stuck on step 1 still.   I can't figure out how to appropriately deal with the prior quarter matter where there is a gap in periods (ie. some quarters do not have either a cancellation or subscription).    for example, if there are cancellations for quarters 2016-3, 2016-4 and 2017-2... I believe the correct outcome should result with the value of cancellations in 2016-4 be the prior cancellations for period of 2017-1.     however, 2017-1 is not a period in the cancellation steam and as such is being associated with the 2017-2 grouping.   

my thought is to first cogroup both cancellation and subscription streams, then determine the prior counts based on that inclusive period stream.  though I don't seem to be able to get the windowing function to order by the grouped period set.

hints???
Sanjoy BiswasSanjoy Biswas
Hi,

I am getting the 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." while validating challenge 3; although the reference line has the attriCost data as its label & value as given in the challenge and it is connected to be filtered by the tenure length toggle. Any suggestions?
Please see below the screenshots for the chart
Toggle at High risk
Toggle at Medium Risk
 
Sanjoy BiswasSanjoy Biswas
Have you seen this kind of problem. Can I reach out to someone in the concerned team who can help? Would be obledged if you can please help me with the contact who can help.
Alexandre Lachmann (SF)Alexandre Lachmann (SF)
Hi
All bindings issues are due to step name (@peter : your saql is ok)
Please follow these names :
User-added image
Regards
 
Alexandre Lachmann (SF)Alexandre Lachmann (SF)
idem for step 3 Sanjoy :-)
Alexandre Lachmann (SF)Alexandre Lachmann (SF)
step 1 for newbee like me !
- union churn+sub to get all quarters
- cogroup quarter+sub with coallesce for null value and windows to get sum of subscribe => TotSub
- cogroug quarter+chrun with coallesce for null value and windows to get previous => CurrentChurn and PreviousChurn
- cogroup ope2 and op3 to get result with correct formula : CurrentChurn/(TotSub-PreviousChurn) as 'Churn'
 
Sanjoy BiswasSanjoy Biswas
Thanks Alexandre. However please see below the step names I have used, do not see any difference:
Steps
Sanjoy BiswasSanjoy Biswas
Hi Alexandre, I made the step names exactly as you had shared and the challenge was successful. Thanks a ton for your help.
Alexandre Lachmann (SF)Alexandre Lachmann (SF)
Tenure_Length_1 !
Keith BordenKeith Borden
Hi Mitesh
How did you get past the error you encountered on Challenge 5, "We couldn’t find the correct information associated with Apex trigger named SetDealPrediction. Confirm the Salesforce object and integration name" ?
Sanjoy BiswasSanjoy Biswas
Hi Keith,

Check if you have used "Tenure" (without quotes) as the name (integration name) for your entry in the Einstein Discovery-Write Back Detail Custom Setting as well as in the Apex trigger named SetDealPrediction.
Mitesh TrailblazerMitesh Trailblazer
Hi Keith,
I have actually earlier used a random name for integration but then I recreated the Custom setting and the trigger once again for the app and that helped me completing the challenge. Hope that helps!

Regards
Mitesh 
Mitesh TrailblazerMitesh Trailblazer
Hi RV8,

For the Step 1 I was also stuck but then the quasi code from Peter Greenbaum helped me clear the challenge. The same can be seen in this message trail. The cogroup on the period should be done prior to windowing in both the cases ie Churn or cancellation and subscription and you should be able to use the calculated column for the churn rate then.

If I share my implementation steps  that would spoil the fun :-)
If you are stuck then will be happy to help 
Regards
Mitesh
Keith BordenKeith Borden
Thanks Mitesh (and Sanjoy).  I deleted and re-created the custom setting and trigger.  I copied and pasted the same text that I had in there before, but this time the challenge passed. :)  Thanks!
LinThawLinThaw
my chart is too ugly but challenge step 1 passed!
please show me your pretty chart.
User-added image
Alexandre Lachmann (SF)Alexandre Lachmann (SF)
User-added image
LinThawLinThaw
oh! nice one thanks.
LinThawLinThaw
hi,
I am stuck on step 3
User-added image
my result image is not bad.
User-added image
how to use filter for this requirement.
"Also, make it possible for the reference line value to filter by length of tenure from the Tenure Length toggle."

my filter is wrong place?
"measureAxis1": {
    "sqrtScale": false,
    "showTitle": true,
    "showAxis": true,
    "referenceLines": [
        {
            "color": "#E84340",
            "label": "{{cell(Attrition_Cost_1.result, 0, \"attrCost\").asString()}}",
            "value": "{{cell(Attrition_Cost_1.result, 0, \"attrCost\").asString()}}"                            
        }
    ],
	"filters": [
	   [
	      "Tenure",
	      "{{ column( Tenure_Length_1.selection, [\"Tenure\"] ).asObject() }}",
	      "in"
	   ]
	],                        
    "title": "Subscription Revenue",
    "customDomain": {
        "showDomain": false
    }
},

Thanks
Alexandre Lachmann (SF)Alexandre Lachmann (SF)
Filter is not needed thanks to automatic facet binding
issue comes from attrition step name : not xxx_1
LinThawLinThaw
Thanks Alexandre Lachmann,

I removed my hard code filters, and edit step names as you mentioned in old post.
User-added image
then, error is changed!
User-added image
automatic facet binding is not working?

Regards,
LinThaw
 
LinThawLinThaw
filter q by {{row(Tenure_Length_1.selection, [0], [\"min\",\"max\"]).asRange(\"Tenure\")}};
After add filter to query of Attrition Cost, its worked!
Julien CARMIGNANIJulien CARMIGNANI
Hi Peter Greenbaum 7 ,
 
I am stuck since several days on the step 1. I have a doubt on how I use the windowing functions to sum over the previous period. Could you please let me know what is wrong in the following SAQL code?
 
q = load "Beattie_Subs";

cancel = group q by ('Churn_Date_Year', 'Churn_Date_Quarter');
cancel = foreach cancel generate cancel.'Churn_Date_Year' + "~~~" + cancel.'Churn_Date_Quarter' as 'ActivityDate_Year~~~ActivityDate_Quarter', count() as 'New Quarter Cancellations';

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

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

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

result = cogroup sub by 'ActivityDate_Year~~~ActivityDate_Quarter' full, cancel by 'ActivityDate_Year~~~ActivityDate_Quarter';
result = foreach result generate coalesce(sub.'ActivityDate_Year~~~ActivityDate_Quarter', cancel.'ActivityDate_Year~~~ActivityDate_Quarter') as 'ActivityDate_Year~~~ActivityDate_Quarter', sum(cancel.'New Quarter Cancellations')/(sum(sub.'New Quarter Subcribers') + sum(sub.'Previous Quarter Subcribers') - sum(cancel.'Previous Quarter Cancellations')) as 'Churn Rate';

Thanks by advance for your help.
Julien
Peter Greenbaum 7Peter Greenbaum 7
Julien,

Hmm.  Looks close.
Try defining the window on line 7 as [-1..-1]
Try defining the window on line 13 a [-1..0]

That's what worked for me.  Good luck
 
Julien CARMIGNANIJulien CARMIGNANI
Thanks Peter for your feedback. I have followed your advises and it is working perfectly. Thank you so much :D

I see that the Churn Rate is greater than 100% on 2018-2 which lloks weird to me:
User-added image
Mathieu NobletMathieu Noblet
Hello fellow trailblazers!

I am stucked on step #2

I created my widget chart as well as my toggle with the static step.
I linked the static step with the chart and the JSON is correct but I'm gitting this error message when trying to display the chart :
"This widget can't be displayed because there is a problem with its source step:
The binding ' cell(Tenure_Length_1.selection, 0, "values").asObject() ' contains an error: No data found at row index 0, column name 'values'."

I tried with several row indexes but it still displays the same error.

Does someone have insights on this point?

Thanks!!!
Here is my JSON :
 
"steps": {
            "Tenure_Length_1": {
                "broadcastFacet": true,
                "label": "Tenure Length",
                "selectMode": "single",
                "type": "staticflex",
                "values": [
                    {
                        "display": "High Risk",
                        "value": [
                            [
                                "count",
                                "*",
                                "A"
                            ],
                            [
                                "count",
                                "*",
                                "B"
                            ],
                            [
                                "count",
                                "*",
                                "C"
                            ]
                        ],
                        "columns": [
                            {
                                "query": {
                                    "measures": [
                                        [
                                            "count",
                                            "*"
                                        ]
                                    ],
                                    "filters": [
                                        [
                                            "Churn",
                                            [
                                                "Yes"
                                            ],
                                            "in"
                                        ]
                                    ]
                                }
                            },
                            {
                                "query": {
                                    "measures": [
                                        [
                                            "count",
                                            "*"
                                        ]
                                    ]
                                }
                            },
                            {
                                "query": {
                                    "measures": [
                                        [
                                            "count",
                                            "*"
                                        ]
                                    ],
                                    "formula": "A/B"
                                },
                                "format": "number"
                            }
                        ],
                        "filters": [
                            [
                                "Tenure",
                                [
                                    [
                                        1,
                                        12
                                    ]
                                ],
                                ">=<="
                            ]
                        ]
                    },
                    {
                        "display": "Medium Risk",
                        "value": [
                            [
                                "count",
                                "*",
                                "A"
                            ],
                            [
                                "count",
                                "*",
                                "B"
                            ],
                            [
                                "count",
                                "*",
                                "C"
                            ]
                        ],
                        "columns": [
                            {
                                "query": {
                                    "measures": [
                                        [
                                            "count",
                                            "*"
                                        ]
                                    ],
                                    "filters": [
                                        [
                                            "Churn",
                                            [
                                                "Yes"
                                            ],
                                            "in"
                                        ]
                                    ]
                                }
                            },
                            {
                                "query": {
                                    "measures": [
                                        [
                                            "count",
                                            "*"
                                        ]
                                    ]
                                }
                            },
                            {
                                "query": {
                                    "measures": [
                                        [
                                            "count",
                                            "*"
                                        ]
                                    ],
                                    "formula": "A/B"
                                },
                                "format": "number"
                            }
                        ],
                        "filters": [
                            [
                                "Tenure",
                                [
                                    [
                                        13,
                                        24
                                    ]
                                ],
                                ">=<="
                            ]
                        ]
                    },
                    {
                        "display": "Low Risk",
                        "value": [
                            [
                                "count",
                                "*",
                                "A"
                            ],
                            [
                                "count",
                                "*",
                                "B"
                            ],
                            [
                                "count",
                                "*",
                                "C"
                            ]
                        ],
                        "columns": [
                            {
                                "query": {
                                    "measures": [
                                        [
                                            "count",
                                            "*"
                                        ]
                                    ],
                                    "filters": [
                                        [
                                            "Churn",
                                            [
                                                "Yes"
                                            ],
                                            "in"
                                        ]
                                    ]
                                }
                            },
                            {
                                "query": {
                                    "measures": [
                                        [
                                            "count",
                                            "*"
                                        ]
                                    ]
                                }
                            },
                            {
                                "query": {
                                    "measures": [
                                        [
                                            "count",
                                            "*"
                                        ]
                                    ],
                                    "formula": "A/B"
                                },
                                "format": "number"
                            }
                        ],
                        "filters": [
                            [
                                "Tenure",
                                [
                                    [
                                        25,
                                        36
                                    ]
                                ],
                                ">=<="
                            ]
                        ]
                    }
                ]
            },
            "Churn_Tenure_1": {
                "broadcastFacet": true,
                "datasets": [
                    {
                        "id": "0Fb1t000000XjFcCAK",
                        "label": "Beattie Subs",
                        "name": "Beattie_Subs",
                        "url": "/services/data/v44.0/wave/datasets/0Fb1t000000XjFcCAK"
                    }
                ],
                "isGlobal": false,
                "label": "Churn Tenure",
                "query": {
                    "measures": "{{ cell(Tenure_Length_1.selection, 0, \"values\").asObject() }}"
                },

 
Mathieu NobletMathieu Noblet
The strangest part of it is that with that JSON I passed the challenge... But I'd like to understand why it doesn't display the chart.
Chintamani "CD" DeshmukhChintamani "CD" Deshmukh
@mathiew - I was struggling with the same issue for some time. my bindings were working but chart wasnt visible. I dont know the exact reason but I deleted whole thing multiple times and recreated. I spent 'a lot' of time on this step and now everything works, looks OK.
Chintamani "CD" DeshmukhChintamani "CD" Deshmukh
Challenge 5 --> Can anyone please help in step - 'Connect Einstein Discovery to Your Custom Fields' where we need to enter 'Prediction Definition Id' from ' Activation Steps'. I am not able to locate this anywhere. 
LinThawLinThaw
Hi Chintamani,

you need to following steps from this link.
User-added image
and then you can find Prediction Definition Id from MODEL. also be careful on label name.
User-added image
User-added image
Good luck, Regards.
LinThaw
Chintamani "CD" DeshmukhChintamani "CD" Deshmukh
LinThaw, thank you for your help and I was able to complete superbadge today. I encountered couple of issues in challenge 5 but not much.
Peter Greenbaum 7Peter Greenbaum 7
Hi guys.  I finally finished the challenges and got the badge!  Thanks for all of your awesome help.  This was an excellent challenge and community experience for me.
 
Mitesh TrailblazerMitesh Trailblazer
Good to hear from you Pete! Lets hope more collaboration in time to come for Superbadge and other community experience.
Ravi LRavi L
All,

I am struck with Step # 2

i was able to create the churn chart  with the below code, but not able to link the toggle, require help
q = load "Beattie_Subs";

q = filter q by 'Tenure' >= 0 && 'Tenure' <= 100;
q_B = filter q by 'Churn' == "Yes";
result = group q by all full, q_B by all;
result = foreach result generate (count(q_B) / count(q))*100 as 'churnRate';

Churn Chart
Chintamani "CD" DeshmukhChintamani "CD" Deshmukh
Change filter q by 'Tenure' >=0 .... row and pass your selection (Something like - filter q by {{row(Tenure_Length_1.selection,[0],[\"min\",\"max\"]).asRange (\"Tenure\")}}; Make sure you use correct step name from your widgets.
Peter Greenbaum 7Peter Greenbaum 7
I would just add that the static step that you're binding to (api name: Tenure_Length_1, label: Tenure Length), should have values of min/max that match the instructions (1/12, 13/24, 25/36):
 
"Tenure_Length_1": {
                "broadcastFacet": false,
                "label": "Tenure Length",
                "selectMode": "single",
                "type": "staticflex",
                "values": [
                    {
                        "display": "High Risk",
                        "value": "1 to 12 months",
                        "min": 1,
                        "max": 12
                    },
                    ...
                ]
            }

Hope this helps, Ravi
Ravi LRavi L
Thanks Chintamani & Peter, timely help. I have moved to 3rd step now...
Ravi LRavi L
I have completed till step 4, need guidence for Step 5 (Einstein Discovery part)...

help required how to get the activation id, not finding the option
Ravi LRavi L
All, thanks a lot, i am able to complete the super badge, this is very challenging and skilled. Appreciate your help.
Jean-Noel CasassusJean-Noel Casassus
Stuck with step 5
Same message appear, trigger have been deleted and created a lot of time same things with the custom settings

Challenge Not yet complete... here's what's wrong:
We couldn’t find the correct information associated with Apex trigger named SetDealPrediction. Confirm the Salesforce object and integration name.

The trigger is working fine and Subscriber records are updated on edit.
In custom settings:
Name = Tenure

and the trigger contain
String CONFIG_NAME = 'Tenure';
 
LinThawLinThaw
Hi Jean-Noel Casassus,
I used this one for single object with no data transformation.
how about you?
trigger SetDealPrediction on Subscriber__c (after insert, after update) {
   if(System.isFuture()) return;
   if(ed_insights.CheckRecursive.runOnce()) {
   // custom Settings' name
   String CONFIG_NAME = 'Tenure';
   ed_insights.TriggerHandler.insertUpdateHandle(CONFIG_NAME);
  }
}
Regards,
LinThaw
 
Simone MouyalSimone Mouyal

Hellooooo! 
Challenge #2

Anyone got binding the toggle to the chart? In my wasn't made it automatically. How can I do this?

Chintamani "CD" DeshmukhChintamani "CD" Deshmukh
Binding toglle wont be automatic, you need to do in in chart - change the filter step with toggle selection. There is answer within this thread itself if you read previous comments carefully. Let me know if you still cant do it.
Szymon Halik 7Szymon Halik 7
Hello guys, I am struggling with the first step in the super badge. The error message is:
Challenge Not yet complete... here's what's wrong: 
We can't confirm this is the correct quarter. Records should be grouped by subscriber activity (sign ups and cancellations). A suggestion is to generate a stream for subscriber records by Subscription Date and
its counts, along with Churn Date and its counts. Ensure both streams for these date fields share a common variable then create a union of both streams.
Close errors
My query looks like this:
q = load "beattie_subs";

cancel = group q by ('Churn_Date__c_Year', 'Churn_Date__c_Quarter');
cancel = foreach cancel generate cancel.'Churn_Date__c_Year' + "~~~" + cancel.'Churn_Date__c_Quarter' as 'ActivityDate_Year~~~ActivityDate_Quarter', count() as 'New Quarter Cancellations';

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

sub = group q by ('Subscription_Date__c_Year', 'Subscription_Date__c_Quarter');
sub = foreach sub generate sub.'Subscription_Date__c_Year' + "~~~" + sub.'Subscription_Date__c_Quarter' as 'ActivityDate_Year~~~ActivityDate_Quarter', count() as 'New Quarter Subcribers';

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

result = cogroup sub by 'ActivityDate_Year~~~ActivityDate_Quarter' full, cancel by 'ActivityDate_Year~~~ActivityDate_Quarter';
result = foreach result generate coalesce(sub.'ActivityDate_Year~~~ActivityDate_Quarter', cancel.'ActivityDate_Year~~~ActivityDate_Quarter') as 'ActivityDate_Year~~~ActivityDate_Quarter', sum(cancel.'New Quarter Cancellations')/(sum(sub.'New Quarter Subcribers') + sum(sub.'Previous Quarter Subcribers') - sum(cancel.'Previous Quarter Cancellations')) as 'Churn Rate';
The produced chart seems to be correct. I don't know what I am missing. Do I need to create new fields(SubscriptionDate_Year, SubscriptionDate_Quarter, ChurnDate_Year, ChurnDate_Quarter) on the Subscriber object or just use those created by EA during the dataflow as I did now?
User-added image
rahul kumar 492rahul kumar 492
Hello All,
I am struggling with the step 3 in the super badge. 
i have created Subscriber Revenue bar chart. 
Now i am Not getting next steps:
4. Create another step, with Attrition Cost as the name , that calculates subscriber attrition cost, [Churned Subscribers (Churn = ‘Yes’) x $950.00].
5. Use the projection name attrCost for your calculation in the previous step.
6. Add a reference line to the Subscriber Revenue chart. 
User-added image

Please guide me for this step!
Chintamani "CD" DeshmukhChintamani "CD" Deshmukh
@rahul kumar 492 - Create a step (Compare table for the calculation given in requirements), name the results column appropriately as suggested.
Add this to your chart as a reference line. Once done, go to SAQL and add result binding of tenure length to this so that reference line changes per your selection. 

Hope this helps.
rahul kumar 492rahul kumar 492
Thanks @Chintamani "CD" Deshmukh , it's work. I mooved to step 4.
Tim CastaTim Casta
Hi Chintamani and rahul,

I'm also stuck on step 3,

In the json, i'm trying to bind the Attrition Cost to the Subscriber Revenue reference line by doing the following :
{
                                "color": "#E84340",
                                "label": "Attrition cost",
                                "value": {{cell(Attrition_Cost_1.result, 0, "attrCost").asString()}}
                            }
                        ],

But I have a message that the json is not valid.

Thanks for helping me.
Peter Greenbaum 7Peter Greenbaum 7
Hey Tim,

The JSON is invalid because you have to wrap the binding in quotes:  
"value": "{{cell(Attrition_Cost_1.result, 0, "attrCost").asString()}}"

Also, i think you need to serialize using asObject(), not asString().

Hope that helps!
Tim CastaTim Casta
Hi Peter,

Thanks for your help.
Just found this page : https://developer.salesforce.com/docs/atlas.en-us.bi_dev_guide_bindings.meta/bi_dev_guide_bindings/bi_dashboard_bindings_wave_designer_set_reference_line.htm

It is working with asString() for both value and label.

Now I'm struggling with the filter using the toogle.
Tim CastaTim Casta
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 !
Deepshikha Rajput 2Deepshikha Rajput 2
hey @lin Thaw. I am stuck @ the Step 2 getting error "

Could not parse binding: Parse error on line 1: ...th_1.selection,[0],[\"min\",\"max\"]).as -----------------------^ Expecting 'INTEGER', '-', 'STRING', ']', got 'IDENTIFIER'."
here is my Saql 
q = load "Beattie_Subs"; filter q by {{row(Tenure_Length_1.selection,[0],[\"min\",\"max\"]).asRange (\"Tenure\")}};q_B = filter q by 'Churn' == "Yes"; result = group q by all full, q_B by all; result = foreach result generate (count(q_B) / count(q))*100 as 'churnRate';
Maanas Desai cognizantMaanas Desai cognizant
@Deepshikha Rajput 2 , please copy  solution carefully...
Line 2 you are missing q=filter q  ....
q = load "Beattie_Subs";
q=filter q by {{row(Tenure_Length_1.selection,[0],[\"min\",\"max\"]).asRange (\"Tenure\")}};
q_B = filter q by 'Churn' == "Yes";
result = group q by all full, q_B by all; result = foreach result generate (count(q_B) / count(q))*100 as 'churnRate';
Tim CastaTim Casta
Hi there !

I'm struggling on step 4 with the cogroup to display data from both datasets:

I'm using :
oem = load "Beattie_OEM_Survey";
subs = load "Beattie_Subs";
q = cogroup oem by 'Region', subs by 'Region';
q = foreach q generate avg(oem.'CSAT') as 'Avg of CSAT', avg(subs.'Tenure') as 'Avg of Tenure';

But i can't get to group by the region... this is driving me crazy
Peter Greenbaum 7Peter Greenbaum 7
Hi Tim,

After you co-group, you generate a stream but your stream is missing the dimension you want to group by, it only has mesures (Avg customer satisfaction and tenure).  You have to add the Region dimension to your stream.  So, something like this would work:
 
q = load "Beattie_Subs";
s = load "Beattie_OEM_Survey";
r = cogroup q by 'Region', s by 'Region';
r = foreach r generate q.'Region' as 'Region', round(avg(s.CSAT),0) as 'avg_CSAT', round(avg(q.'Tenure'),0) as 'avg_Tenure';
r = order r by 'avg_CSAT' asc;

Hope this helps.

 
Tim CastaTim Casta
Thanks A LOT Peter !
This has done the trick !
Dave ParadiseDave Paradise
Just finished this one. Was pretty fun though building the SAQL queries was defintiely the hardest part since it felt like they really threw us into the deep end with those. Thanks to everyone in the thread for sharing their questions and insights!
Maanas Desai cognizantMaanas Desai cognizant
Yes indeed it was one ot the most trickiest challenge Being a beginner, Lets play Salesforce videos helped me alot  Also thanks a lot to all the people in this forum. CHEERS :-)
Johan KarlsteenJohan Karlsteen
Thanks to this thread I made it through this superbadge, it was one of the hardest so far given my limited experience with Einstein Analytics. You guys rock!
Juray HudakJuray Hudak
Hi All you passed this superbadge, congrats!, with help from this thread especially from Peter Greenbaum 7 explanations I did steps 1 - 4 
I am stuck on step #5 now, what they mean on 
Create a story in Einstein Discovery
 4.Name your final prediction Predicted Tenure.  Name the Story Predicted Tenure ? Because I  have everything working even on edit 
Subscriber object In salesforce  I get: Tenure Outcome 16 and Tenure Explanation +0.435 because Modem Age is 1 - 2 Years and Tenure Prescription +3.568 if you change Modem Age to New (with many more rows)
So Subscriber object is fine, trigger is working also , but still getting error:
Challenge Not yet complete... here's what's wrong: 
We can't find your recommendation. Confirm a 'Predicted Tenure' recommendation exists.

 
Juray HudakJuray Hudak
Thank you all, I did it:You've earned yourself the most super of badges, and a ton of points.
The problem vas the deploy model name this should follow Predicted tenure . But thanks all guys !
LinThawLinThaw
Glad to hear! you all can do it. Let's rock all superbadges!!
Ryan Tretter 9Ryan Tretter 9
Hi, All.

I am stuck on step 1 of this superbadge.  My chart looks exactly as the sample in the challenge and I have my chart marker set on the first quarter that is showing a Churn Rate; however, I keep getting the error message below:
User-added image
Here is my chart and saql:
User-added image
 
q = load "Beattie_Subs";

Subscribers = group q by ('Subscription_Date_Year', 'Subscription_Date_Quarter');
Subscribers = foreach Subscribers generate 'Subscription_Date_Year' + "-" + 'Subscription_Date_Quarter' as 'ActivityDate_Year-ActivityDate_Quarter', count() as 'Current Quarter Subscribers';

Churns = group q by ('Churn_Date_Year', 'Churn_Date_Quarter');
Churns = foreach Churns generate 'Churn_Date_Year' + "-" + 'Churn_Date_Quarter' as 'ActivityDate_Year-ActivityDate_Quarter', count() as 'Current Quarter Churns';

Result = group Subscribers by 'ActivityDate_Year-ActivityDate_Quarter' full, Churns by 'ActivityDate_Year-ActivityDate_Quarter';
Result = foreach Result generate coalesce(Subscribers.'ActivityDate_Year-ActivityDate_Quarter', Churns.'ActivityDate_Year-ActivityDate_Quarter') as 'ActivityDate_Year-ActivityDate_Quarter', sum(Subscribers.'Current Quarter Subscribers') as 'Current Quarter Subscribers', sum(Churns.'Current Quarter Churns') as 'Current Quarter Churns';
Result = group Result by ('ActivityDate_Year-ActivityDate_Quarter', 'Current Quarter Subscribers', 'Current Quarter Churns');
Result = foreach Result generate 'ActivityDate_Year-ActivityDate_Quarter', sum('Current Quarter Subscribers') as 'Current Quarter Subscribers', 'Current Quarter Churns', sum('Current Quarter Subscribers') over ([..-1] partition by all order by 'ActivityDate_Year-ActivityDate_Quarter') - coalesce(sum('Current Quarter Churns') over ([-1..-1] partition by all order by 'ActivityDate_Year-ActivityDate_Quarter'),0) as 'Previous Quarter Subscribers';
Result = foreach Result generate 'ActivityDate_Year-ActivityDate_Quarter', 'Current Quarter Churns'/(coalesce('Previous Quarter Subscribers',0) + coalesce('Current Quarter Subscribers',0)) as 'Churn Rate';

I know that Q3 2016 has to be the first quarter with a churn rate because I also pulled the dataset into Excel and pivoted the data on Churn Date Year/Quarter and that is the first quarter with any cancellations.  Any thoughts or suggestions would be really appreciated as I'm getting a bit frustrated with this one.

Thanks!
Sandeep Ramineni 21Sandeep Ramineni 21
I am stuck on challenge 3. I created a new step and named it Attrition Cost and my code initially before binding it to toggle widget is 
q = load "Beattie_Subs";
 
q = filter q by 'Tenure' >= 0 && 'Tenure' <= 100;
q_B = filter q by 'Churn' == "Yes";
result = group q by all full, q_B by all;
result = foreach result generate count((q_B))*950 as 'attrCost';

After adding the attrition cost as reference line and updating the JSON as below:
"referenceLines": [
                                {
                                    "color": "#E84340",
                                    "label": "Attrition Cost",
                                    "value": "{{cell(Attrition_Cost_1.result, 0, \"attrCost\").asObject()}}"
                                }

I am updating the JSON for Attrition Cost to:
q = load \"Beattie_Subs\";
q = filter q by{{row(Tenure_Length_1.selection,[0],[\"min\",\"max\"]).asRange (\"Tenure\")}};

q_B = filter q by 'Churn' == \"Yes\";
result = group q by all full, q_B by all;
result = for each result generate count((q_B))*950 as 'attrCost';

I am still unable to go to next challenge. Sometimes it throws an error for Attrition Cost and sometimes it doesn't. could anyone help me here?
akash_dev__cakash_dev__c
Hi Everyone -

I am stuck on the challenge 3 and getting the error : 

query :

"query": "beattieSubscribers = load \"Beattie_Subs\"; \ntenuredSubscribers = filter beattieSubscribers by{{row(Tenure_Length_1.selection,[0],[\"min\",\"max\"]).asRange (\"Tenure\")}}; \nchurnedSubscribers = filter tenuredSubscribers by 'Churn' == \"Yes\"; \ngroupedSubscribers = group tenuredSubscribers by all full, churnedSubscribers by all;\nattrCost = foreach groupedSubscribers generate count(churnedSubscribers)*950 as 'attrCost';",

adding attrition cost as refernce line in JSON: 

"referenceLines": [
                            {
                                "color": "rgb(0, 161, 224)",
                                "label": " attrition costs",
                                "value": "{{cell(Attrition_Cost_1.result,0,\"attrCost\").asString()}}"
                            }
                        ],

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.


Please help guys, i want to complete this superbadge.

Regards,
Akash Garg
akash_dev__cakash_dev__c
Hi @Sandeep Ramineni, 

I found the workaround please update the refernceLines JSON as below :

"referenceLines": [
                            {
                                "color": "#E84340",
                                "label": "{{cell(Attrition_Cost_1.result,0,\"attrCost\").asString()}}",
                                "value": "{{cell(Attrition_Cost_1.result,0,\"attrCost\").asString()}}"
                            }
                        ],

It helped me to go to the next challenge, I hope it would work for you too.
 
Sandeep Ramineni 21Sandeep Ramineni 21
Hi Akash,

I tried updating the label as well and the value field in JSON but it didn't work. I am not getting any error but when I save and click preview, the toggle changes for Churn Tenure and does nothing for Subscriber Count. I am getting the same error as you got when I check the challenge.
Sandeep Ramineni 21Sandeep Ramineni 21
Hi @LinThaw,

Could you help me with Challenge 3? I tried all changes I can think of and still not able to move ahead.

Cheers.
Sandeep
Sandeep Ramineni 21Sandeep Ramineni 21
Finally was able to clear Challenge 3. 
LinThawLinThaw
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;
User-added image
[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
Sandeep Ramineni 21Sandeep Ramineni 21
Hi @LinThaw,
I found the issue, the code was correct, I forgot to run the query in Attrition Cost step and it caused the problem. I deleted the step and reference lines and saved it and then started from beginning and then it worked. Now onto Challenge 4.
LinThawLinThaw
Great, it helps other too.
Sandeep Ramineni 21Sandeep Ramineni 21
Finally finished the Super Badge.. Thanks a lot for all who contributed to this page. 
Felipe LuqueFelipe Luque
Hi all,
I did it, my first super badge!!
Thanks Peter, Alexandre, LinTaw, Mathieu,Chintamani and the rest of fellows.
 
Peter Greenbaum 7Peter Greenbaum 7
Congratulations Felipe!  It was a fun badge, wasn't it?
Ryan Tretter 9Ryan Tretter 9
I finally completed the superbadge!  I had a major issue with the entire thing because I had done all of the steps first as I was reading through it all and then tried to validate the steps after.  I'm guessing that was throwing everything off so I had to go back and start over doing one step at a time.  I literally didn't change a thing in the steps I had done the first time, I just think it wasn't able to correctly validate each step since I had worked ahead.  Just thought I would mention this in case anyone else has done the same thing and is stuck.
Felipe LuqueFelipe Luque
It was funny in deed, I'll try to help trailblazers who need as I would have never done it without this collaboration thread
Punit MinaPunit Mina

Hi All,

I am getting following error beacuse i am unable to bind widget and chart->

 

Display Churn by Tenure

User-added image

Any thought or advise would be apprecitable!!

Felipe LuqueFelipe Luque
Hi Punit,

Can you post the jsons of churn_tenure and tenure_length steps?, I had some different errors: sometimes the json generates two slashes (\\), the index in the binding line must be in brackets ([0]) and so on
Punit MinaPunit Mina
Hi Felipe,

Following is the json section of churn_tenure and tenure_length: Please have a look and let me know where am i doing mistake..

 "steps":{"Tenure_Length_1":{"broadcastFacet":false,"label":"Tenure Length","selectMode":"single","start":{"display":[]},"type":"staticflex","values":[{"display":"High Risk","value":"1 to 12 months"},{"display":"Medium Risk","value":"13 to 24 months"},{"display":"Low Risk","value":"25 to 36 months"}],"numbers":[],"strings":[],"groups":[]},"Churn_Tenure_1":{"broadcastFacet":true,"groups":[],"label":"Churn Tenure","numbers":[],"query":"q = load \"Beattie_Subs\";\r\n\r\nq = filter q by 'Tenure' >= 0 && 'Tenure' <= 100;\r\nq_B = filter q by 'Churn' == \"Yes\";\r\nresult = group q by all full, q_B by all;\r\nresult = foreach result generate (count(q_B) / count(q))*100 as 'churnRate';","receiveFacet":true,"selectMode":"single","strings":[],"type":"chart","useGlobal":true,"parameters":{"autoFitMode":"keepLabels","showValues":true,"bins":{"breakpoints":{"high":100,"low":0},"bands":{"high":{"color":"#008000","label":""},"low":{"color":"#B22222","label":""},"medium":{"color":"#ffa500","label":""}}},"legend":{"descOrder":false,"showHeader":true,"show":true,"customSize":"auto","position":"right-top","inside":false},"axisMode":"multi","tooltip":{"showBinLabel":true,"measures":"","showNullValues":true,"showPercentage":true,"showDimensions":true,"showMeasures":true,"customizeTooltip":false,"dimensions":""},"visualizationType":"hbar","title":{"fontSize":14,"subtitleFontSize":11,"label":"","align":"center","subtitleLabel":""},"binValues":false,"trellis":{"flipLabels":false,"showGridLines":true,"size":[100,100],"enable":false,"type":"x","chartsPerLine":4},"showActionMenu":true,"measureAxis2":{"sqrtScale":false,"showTitle":true,"showAxis":true,"title":"","customDomain":{"showDomain":false}},"measureAxis1":{"sqrtScale":false,"showTitle":true,"showAxis":true,"title":"","customDomain":{"showDomain":false}},"theme":"wave","dimensionAxis":{"showTitle":true,"customSize":"auto","showAxis":true,"title":"","icons":{"useIcons":false,"iconProps":{"fit":"cover","column":"","type":"round"}}},"applyConditionalFormatting":true}}}}
Felipe LuqueFelipe Luque
Hi Punit

I see a couple of things, you have to connect/bind the two steps through the query in churn_tenure, this is what I have:
"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';",

I also have 2 additional labels in tenure length step, min an max:
 "values": [
                    {
                        "display": "Low Risk",
                        "value": "1 to 12 months",
                        "min": 1,
                        "max": 12
                    },
                    {
                        "display": "Medium Risk",
                        "value": "1 to 12 months",
                        "min": 13,
                        "max": 24
                    },
                    {
                        "display": "High Risk",
                        "value": "1 to 12 months",
                        "min": 25,
                        "max": 36
                    }
Punit MinaPunit Mina
Thanks to Felipe, 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 and min/max.
 
Felipe LuqueFelipe Luque
You´re welcomed
Punit MinaPunit Mina
Hi Felipe,

I am getting following error in step3. where i need to add tenure length toggle .

User-added image

And My Visual :
User-added image

Query part:
   "query": "q = load \"Beattie_Subs\";\r\nq = filter q by 'Tenure' in all;\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;",

referenceLines->
 "referenceLines": [
                                    {
                                        "color": "#E84340",
                                        "label": "{{cell(Attrition_Cost_1.result, 0, \"attrCost\").asString()}}",
                                        "value": "{{cell(Attrition_Cost_1.result, 0, \"attrCost\").asString()}}"
                                    }
                                ],

Please advise....
Felipe LuqueFelipe Luque
Hi Punit,

More binding needed, ;), and perhaps single quotes around attrcost, here´s my query for attrition_cost step:

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

Apart from this, where did you locate referencelines?, I had some doubts regarding this, it worked for me putting reference tag in chart_4/chart_5 tags
Maanas Desai cognizantMaanas Desai cognizant
All solutions are already provided on top! Still people are not able to copy paste.... This superbadge has just become a copy paste affair now lost its worth! ,😑
Felipe LuqueFelipe Luque
Actually, the value of this badge is more or less 100$
Punit MinaPunit Mina
Hi Felipe | Anyone,

Do you have any dumps or quiz related matterial for this certification(Salesforce Certified Einstein Analytics & Discovery Consultant (WI19))?
if you have, Please provide the details.

Thanks!! 


 
Silvina Garrido Matos 2Silvina Garrido Matos 2
Hi 

I am stuck on Step #4 can someone help me with the names of the Steps? It seems that I have a misspelling somewhere.
User-added image

User-added image
Many thanks! 
Felipe LuqueFelipe Luque
Hi Silvina,

Did you add the reference in beattie survey chart?
Silvina Garrido Matos 2Silvina Garrido Matos 2
Hi Felipe, 

Many thanks! I don't really know what caused the error but I signed in again, it was fixed. I've already finished the Superbadge. 

Kind regards, 
Felipe LuqueFelipe Luque
Congrats!
Ramesh YeddulaRamesh Yeddula
Can any one help me in completing Challenge 3,I suspect the value is different from what every one is getting because of region Massachusetts.I am getting the following error and also attaching the JSON of my dashboard.Challenge Error

{
                "type": "saql",
                "query": "q = load \"Beattie_Subs\";\r\nq= filter q by {{row(Tenure_Length_1.selection,[0],[\"min\",\"max\"]).asRange (\"Tenure\")}};\r\nq_B = filter q by 'Churn' == \"Yes\";\r\nresult = group q by all full, q_B by all;\r\nresult = foreach result generate count((q_B))*950 as 'attrCost';",
                "useGlobal": true,
                "numbers": [],
                "groups": [],
                "strings": [],
                "label": "Attrition Cost",
                "visualizationParameters": {
                    "type": "chart",
                    "parameters": {
                        "visualizationType": "hbar",
                        "autoFitMode": "keepLabels",
                        "theme": "wave",
                        "title": {
                            "label": "",
                            "fontSize": 14,
                            "subtitleLabel": "",
                            "subtitleFontSize": 11,
                            "align": "center"
                        },


 "referenceLines": [
                            {
                                "color": "#E84340",
                                "label": "{{cell(Attrition_Cost_1.result, 0, \"attrCost\").asString()}}",
                                "value": "{{cell(Attrition_Cost_1.result, 0, \"attrCost\").asString()}}"
                            }
                        ],
                        "title": "Subscription Revenue",
                        "customDomain": {
                            "showDomain": false
Ramesh YeddulaRamesh Yeddula
@ Felipe Luque : Could you please help me on this?
Peter Dirksen 7Peter Dirksen 7
I'd like to see the values in the table form first, and then merge them together.  What do I need to do to the following code (just for cancels) to have it coalesce the proper zero values for quarters first.

q = load "Beattie_Subs";

cancel = group q by ('Churn_Date_Year', 'Churn_Date_Quarter');
cancel = foreach cancel generate cancel.'Churn_Date_Year' + "~~~" + cancel.'Churn_Date_Quarter' as 'ActivityDate_Year~~~ActivityDate_Quarter', count() as 'New Quarter Cancellations';

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

As you can see the data skips quarter 2017-1. 
Daniel Stange (dst14)Daniel Stange (dst14)
The coalesce has no effect here because Churn_Date is always linked to a churned subscriber. Coalesce would set the value to 0 in case there was a row created by at all. What you're doing is a different piece of cake:

cancel = foreach cancel generate cancel.'Churn_Date_Year' + "~~~" + cancel.'Churn_Date_Quarter' as 'ActivityDate_Year~~~ActivityDate_Quarter', count() as 'New Quarter Cancellations';
cancel = group cancel by ('ActivityDate_Year~~~ActivityDate_Quarter');

"cancel" now contains a row for each Quarter someone churned, but it doesn't have a row for Quarter w/o chruned subscribers.

What you'd need is one stream (e.g. "active") that contains all subscribers per unit of time, while cancel contains churned subscribers per unit of time. If you cogroup both now on quarters, coalesce would set rows to zero where there are active scubscribers but no chruned subscribers. But as you don't have the date information for quarter without churned subscribers, there's no row count and not even a row. so coalesce won't have an effect
 
Felipe LuqueFelipe Luque
Hi Ramesh,

Did you got it?, your json is exactly the same as mine´s
If not, I would face one error at a time, leave/delete the reference line for now and check if the binding it´s not working in the user interface.
Felipe LuqueFelipe Luque
Hi again,

I apologize, what I told you is a non sense
ekaizerekaizer
Hi Everyone,

I got stuck at Step 1 with a weird EM : 

User-added image

The query is there, the field is created (with the name Churn Rate), the chart displays correctly, the dashboard is saved. I deleted my dashboard and started over, I received the same error, I created a brand new org, set up the dashboard again and received the same error. Finally, I reached out to Trailhead Support and they directed me to this thread.

Would anyone be able to give me a hand? I would really like to continue with this Superbadge.. Thanks in advance!
 
Shahbaz Chandarki 8Shahbaz Chandarki 8
I am stuck in Step 5. Gettig the below error : 
Challenge Not yet complete... here's what's wrong: 
We can't find your recommendation. Confirm a 'Predicted Tenure' recommendation exists.
Close errors.
What exactly I am missing here.
Shahbaz Chandarki 8Shahbaz Chandarki 8
Step 5 : I have completed almost all the steps related to the story. I can see the 3 custom field values being populated wit values in the Subscribers Details page as soon as i Update the record. I just dont understand the last step :  'Name your final prediction Predicted Tenure.' What exactly do they mean by this step.
I am getting the same error while checking the chages.
User-added image

Can you please help me with this. I am stuck with only the last step for this super badge.
Mathieu NobletMathieu Noblet
Hi @Shahbaz

I just finished the superbadge! The workaround is to go in the model manager and create a brand new model called Predicted Tenure. After that you should be able to complete the challenge.
HariprasathHariprasath
Hi All,

I am also following the Analytics Insight Specialist superbadge and I am stuck in the Challenge 3. I did everything and can able to create the bar chart as follows that is similler to the expected one in the challenge. But I got the following error,

We can't confirm the Subscriber Revenue chart is filtering by the Tenure Length toggle. Confirm there's a binding that filters attrition costs displayed in the reference line.

User-added image
NehashriNehashri
Thank you All who contributed here. Was able to finish this superbadge after a long time. Learned a lot with this one. :)
Ruth ForeroRuth Forero
Hi, 
Guys I'm so confused right now, I can't find Model Manager, can you  please tell me if there is any permission that I'm missing? I reviewed everywhere and I can't resolve it :(
Thanks.
NehashriNehashri
Hi @Ruth,
Do you have Einstein Discovery enabled? Also please verify if you have Einstein Plus Admin user permission enabled.
User-added image
Vijay Ramesh 19Vijay Ramesh 19
Hi @Mathieu / Nehashri,

I tried create new modal, create new story and deploy modal, created custom setting record again, deleted and re-created trigger again...  But still no luck facing same error 'Cannot find information related in the trigger.  Please confirm object and integration name'.

Any help
Vijay Ramesh 19Vijay Ramesh 19
Hi @LinThaw will you be in position to help me.

I tried create new modal, create new story and deploy modal, created custom setting record again, deleted and re-created trigger again...  But still no luck facing same error 'Cannot find information related in the trigger.  Please confirm object and integration name'.

Any help
LinThawLinThaw
Hi Vijay Ramesh,

Please try to check what is going wrong in debug log.

<steps to check debug log>
1. open developer console
2. run verify step in trailhead
3. open log in developer console
4. use ctrl+p to open [Select Panels]
5. mark [Source] checkbox

<sample screen capture>
User-added image

Regards,
LinThaw
Shantanu Buwa 5Shantanu Buwa 5

step 1- using union worked for me however the chart looks weird, churn rate in negative anyone have any idea of any function which can turn negative value to positive?

q = load "Beattie_Subs";
q1 = group q by ('Subscription_Date_Year', 'Subscription_Date_Quarter');
q1 = foreach q1 generate 'Subscription_Date_Year' + "-" + 'Subscription_Date_Quarter' as 'ActivityDate_Year-ActivityDate_Quarter', sum(count()) over ([-1..0] partition by all order by (Subscription_Date_Year, Subscription_Date_Quarter)) as'current and previous sub';


q2 = group q by ('Churn_Date_Year', 'Churn_Date_Quarter');
q2 = foreach q2 generate 'Churn_Date_Year' + "-" + 'Churn_Date_Quarter' as 'ActivityDate_Year-ActivityDate_Quarter', count() as 'current cancellation', sum(count()) over([-1..-1] partition by all order by (Churn_Date_Year,Churn_Date_Quarter) ) as 'prev_cancellation' ;

q3= union q1,q2;
q3 = group  q3 by ('ActivityDate_Year-ActivityDate_Quarter');
q3 = foreach q3 generate 'ActivityDate_Year-ActivityDate_Quarter' as ' subscriber activity',(coalesce(sum('current cancellation'),0)/( coalesce(sum('current and previous sub'),0) -  coalesce(sum('prev_cancellation'),0) )) *100 as 'Churn_Rate';
          
          

Vijay Ramesh 19Vijay Ramesh 19
Hi @LinThaw

After all regenerating Beattie Subs dataset, custom setting integration name 'Tenure', Process Builder and Trigger, still facing the issue.  

I could see records getting updated by the trigger and populating the three Tenure field values., however challenge throws below error still.

We couldn’t find the correct information associated with Apex trigger named SetDealPrediction. Confirm the Salesforce object and integration name.

In the debug log transaction is as follows., i could not figure the not.

User-added image
LinThawLinThaw
Hi Vijay Ramesh,

Please try to delete and re-created the trigger and custom setting.
If possible please switch to Lightning Experience before verify.

User-added image
User-added image
how many log file did you see after verify from Trailhead?
have you any workflow in your org?
did you complete all steps from business requirement?

Regards,
LinThaw
Vijay Ramesh 19Vijay Ramesh 19
Hi @LinThaw,

a) Log file is not generateing while verifying the challenge.   The log file which posted for your reference, from when updating the subscriber record.
b) No, I do not have any workflows.
c) Yes I did complete steps from business requirement.

This challenges focus on Managed Package component, Trigger, Subscriber Object & Fields, and Custom Settings right., Everything looks good but still i face that  issue.  

 
Vijay Ramesh 19Vijay Ramesh 19
@LinThaw, 

I am once again done with Custom Settings & Apex Trigger delete and recreation.

Following are the components.

Custom SettingsApex TriggerProcess Builder

Gone to lightning experience before verifying the challenge.

Verify Challenge -  Still No Luck for me.

Error
LinThawLinThaw
Hi Vijay Ramesh, I am not sure, please deactivate process and try verify again.
Dmitry Dmitriev 5Dmitry Dmitriev 5
Hello!
Having same error as Vijay on Challenge 5, "We couldn’t find the correct information associated with Apex trigger named SetDealPrediction. Confirm the Salesforce object and integration name" 
Recreating trigger and custom setting, as well as redeploying predictive model didn't help.
I am wondering if something went wrong and I need to start all over again from step 1
Ruth ForeroRuth Forero
Hi, I'm having same error on Challenge 5. Any clue about how to resolve it?
Shantanu Buwa 5Shantanu Buwa 5

Hi @Peter Greenbaum 7 I am facing same issue. step names are right almost everything is as you have mentioned still face the error 

 

Challenge Not yet complete... here's what's wrong: 
We can't find the 'Churn Tenure" chart. Check the step name and spelling.
Close errors

Please help.

Shantanu Buwa 5Shantanu Buwa 5

Challenge Not yet complete... here's what's wrong: 
We can't confirm the binding syntax for the Churn Tenure chart. Check that toggle widget selections are updating the Churn Tenure chart. Confirm the binding is using the correct step.
Close errors
Josh WatkinsJosh Watkins
I'm super confused by Step 2, I just don't see why it's not working. What's strange is that the trailhead validation actually recognised this challenge as correct, but the toggle just doesn't affect the data in the chart and I wouldn't like to continue until I understand why this isn't working. What's more, the chart containing the Chart_Tenure step doesn't display and presents the following error:

"Analytics encountered a problem with this step [churn_tenure].
Could not parse binding: Parse error on line1: ...th_1.selection,[0],[\"min\",\"max\"]).as ------------------^ Expecting 'INTEGER', '-', 'STRING', '}' got 'IDENTIFIER'."


Here's my code:

Tenure Length Static Step:
         
  },
            "Tenure_Length_1": {
                "broadcastFacet": true,
                "label": "Tenure Length",
                "selectMode": "single",
                "type": "staticflex",
                "values": [
                    {
                        "display": "High Risk",
                        "value": "1 to 12 months",
                        "min": 1,
                        "max": 12
                    },
                    {
                        "display": "Medium Risk",
                        "value": "13 to 24 months",
                        "min": 13,
                        "max": 24
                    },
                    {
                        "display": "Low Risk",
                        "value": "25 to 36 months",
                        "min": 25,
                        "max": 36
                    }
                ]


Chart Tenure Step

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

Any help would be appreciated!
Shantanu Buwa 5Shantanu Buwa 5

Hi Josh,

In you dashboard JSON as you view the querry is the binding enclosed in "{{row(Tenure_Length_1.selection,[0],[\"min\",\"max\"]).asRange(\"Tenure\")}} " ?

If yes it might give the error expecting integer got string.

Josh WatkinsJosh Watkins

Hi Shantanu,

Do you mean is the binding enclosed in quotation marks? If that is your question, the answer is no. here is the dashboard JSON:

 

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

Is this wrong?

Josh WatkinsJosh Watkins
I figured it out. For some reason when saving the binding in the step, the dashboard JSON was putting an extra two back-slashes around the 'min', 'max' and 'Tenure' strings like below:

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

I deleted them so that there was only one, and it worked fine. Any idea why the JSON might have done this? I certainly didn't put those extra slashes in, I just assumed at first it was something the JSON needed.

Anyway, solved :)
NI7NI7
Hi Lin Thaw,

I completed all steps for Challenge 5 still seems to experience the attached error, can you help please?ErrorPredictions got written to SF record
 
Deepesh Dubey 7Deepesh Dubey 7
Hi N17,
I think you'll need to go to your story click the improvements tab and create another story with the name "predicted tenure". then create a data model through that story again naming "predicted tenure" and change the prediction id in the custom setting as well. 

also in my case the fields tenure output etc are not getting populated like yours. what should i do for that.
HariprasathHariprasath
Hi N17,

I assumed that you followed this link (https://help.salesforce.com/articleView?id=bi_edd_wb_native.htm&type=5) to do all the prerequisite for this challenge. After creating the story with any name just click the drop down arrow button which is exist in right top corner. Click Deploy Model -> In the first screen just give the name 'predicted tenure' as Goal Title -> next screen select Subscriber object -> Map Fields -> No segment filter -> Add variable(Tick the variables) -> Reveiw -> Deploy.

It will work because that's what I did to overcome the exact issue you mentioned above
Dmitry Dmitriev 5Dmitry Dmitriev 5
Hi!
Anyone had an error "We couldn’t find the correct information associated with Apex trigger named SetDealPrediction. Confirm the Salesforce object and integration name" on the final step of the superbadge? And found a solution?
Please share)!
Appreciated,
Dmitry
 
Kalidas PonrajKalidas Ponraj
If anyone share step by step solution of Challenge 3 in Einstein Analytics and Discovery Insights Specialist
I am stuck on this challenge more number of weeks.
Alex van der MerweAlex van der Merwe
Can someone please let me know how I bind code to have the reference line in challenge number 3. Also I am getting an error 
We can't find the Subscriber Revenue step. Check step name and spelling. even though I have the step and the spelling is correct. 

 
Teo PopaTeo Popa
With regard to Step 4, if anyone is struggling adding chart markers to the Beattie Survey, I was having trouble finding an area to click on the chart to trigger adding a marker. I had to go into the JSON, copy the structure of the marker added in the Churn Rate chart, and then modify the parameters. After a few modifications, the chart marker showed up on my Beattie Survey chart, and then I was able to click on it and add the further parameters in the UI, thereby updating the JSON. Final JSON looked like this: 
"markers": [
                        {
                            "measure": "Beattie Survey",
                            "row": [
                                "Illinois"
                            ],
                            "properties": {
                                "backgroundColor": "#193F61",
                                "borderColor": "#193F61",
                                "measures": [
                                    "Beattie Survey"
                                ],
                                "customText": [],
                                "isBlinking": false,
                                "defaultShow": true,
                                "showDimensions": true,
                                "showMeasures": true,
                                "dimensions": [
                                    "Region",
                                    "Avg_of_CSAT",
                                    "Avg_of_Tenure"
                                ]
                            }
                        },
                        {
                            "measure": "avg_CSAT",
                            "row": [
                                "Illinois"
                            ],
                            "properties": {
                                "backgroundColor": "#193F61",
                                "borderColor": "#193F61",
                                "measures": [
                                    "avg_CSAT",
                                    "avg_Tenure"
                                ],
                                "customText": [],
                                "isBlinking": false,
                                "defaultShow": true,
                                "showDimensions": true,
                                "showMeasures": true,
                                "dimensions": [
                                    "Region"
                                ]
                            }
                        },
                        {
                            "measure": "avg_Tenure",
                            "row": [
                                "Illinois"
                            ],
                            "properties": {
                                "backgroundColor": "#193F61",
                                "borderColor": "#193F61",
                                "measures": [
                                    "avg_CSAT",
                                    "avg_Tenure"
                                ],
                                "customText": [],
                                "isBlinking": false,
                                "defaultShow": true,
                                "showDimensions": true,
                                "showMeasures": true,
                                "dimensions": [
                                    "Region"
                                ]
                            }
                        }
                    ],
Saheli Ghosh 7Saheli Ghosh 7
Hi @LinThaw,
I was just following the steps you mentioned..But still getting an error..Just check it out and help me with some solutions..
Error what I am getting
SOQL for Subcriber Revenue:

q = load "Beattie_Subs";
q = group q by 'Region';
q = foreach q generate 'Region' as 'Region', sum('Total_Charges') as 'Sum of Total Charges';
q = order q by 'Region' asc;
q = limit q 2000;

SOQL for Attrition Cost:User-added image

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;
User-added image

Thank You
Saheli
Neeta JainNeeta Jain
Iam still haveing issue with same error: 
We can't confirm the Subscriber Revenue chart is filtering by the Tenure Length toggle. Confirm there's a binding that filters attrition costs displayed in the reference line.

Any ideas?
Ilija StojicIlija Stojic
I passed Challenge 5 (Step #5) despite getting an error when updating a cancelled subscriber.  Does anyone know if the latest managed package for the write-back has any issues?  I followed the steps defined in the help (https://help.salesforce.com/articleView?id=bi_edd_wb_native.htm&type=5) (installed package, configured, created custom fields, deployed the story etc.) but receive some bizarre system errors.

Configuration of Write Back:
Write Back Field settings

Error:
Apex class errors

The Apex classes mentioned are managed so I'm unable to view the lines in question.  This isn't as frustrating as thinking you have absolutely correct and not passing the challenge, but it is fairly aggravating to not know why something broke.  
Stéphane MiretStéphane Miret
Hi @Ilija Stojic,

I'm Having the exact same issue here. Did you find any kind of solution / workaround ?
Does anyone have an idea why this might occur ?

Thanks in advance

User-added image
Stéphane MiretStéphane Miret
Update : I have done challenge 5 again starting from a brand new org. The same error occured but the challenge passed.
Robert NoceraRobert Nocera
Anybody figure out the Apex Trigger error?  I am getting the same error Stephanie and
Ilija did.  I passed the certificaiton but it doesn't actually work.
Saritha K 1Saritha K 1
Hi Saheli, I am also facing the same issue & Reference Line amount is showing 3420000 instead of 3038100. Can you pls help how to resolve if you have done with this step.
Maurice KooijMaurice Kooij
Hey community, I'm still getting the error after following the appropriate steps:
User-added image
While the bindings are okay:
User-added image

And if we look at the step names, we can see this:

User-added image
I've been working on this challenge for a couple of days now but can't complete step 2.

 
Maurice KooijMaurice Kooij
Okay this was annoying. I've created a new org and saved the same query and it worked.
rachanaravirachanaravi
This thread was really helpful. I could reach till the Challenge 4. Thanks to everyone who has shared the comments.

I am stuck with challenge 4. Here are the screenshots for the error and the charts.

User-added image

User-added image

Please let me know if anyone has come across with similar error.

 
Brad WiseBrad Wise
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 
Tenure Length

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.
Mohammad Nadeem 9Mohammad Nadeem 9
Challenge 4

Please help I am stucked on this step
Done till this
above is the step i have done till now
Pramod V 3Pramod V 3
Hi,

Tried various combinations to get rid of this error, but couldn't eradicate. What am I missing here?
We can't find a 'Churn Rate' step. Confirm the step name and spelling.

Here is my code:
q = load "Beattie_Subs"; cancel = group q by ('Churn_Date_Year', 'Churn_Date_Quarter'); cancel = foreach cancel generate cancel.'Churn_Date_Year' + "~~~" + cancel.'Churn_Date_Quarter' as 'ActivityDate_Year~~~ActivityDate_Quarter', count() as 'New Quarter Cancellations'; cancel = group cancel by ('ActivityDate_Year~~~ActivityDate_Quarter'); cancel = foreach cancel generate cancel.'ActivityDate_Year~~~ActivityDate_Quarter' as 'ActivityDate_Year~~~ActivityDate_Quarter', coalesce(sum(cancel.'New Quarter Cancellations'),0) as 'New Quarter Cancellations', coalesce(sum(sum('New Quarter Cancellations')) over ([-1..-1] partition by all order by ('ActivityDate_Year~~~ActivityDate_Quarter')),0) as 'Previous Quarter Cancellations'; sub = group q by ('Subscription_Date_Year', 'Subscription_Date_Quarter'); sub = foreach sub generate sub.'Subscription_Date_Year' + "~~~" + sub.'Subscription_Date_Quarter' as 'ActivityDate_Year~~~ActivityDate_Quarter', count() as 'New Quarter Subcribers'; sub = group sub by ('ActivityDate_Year~~~ActivityDate_Quarter'); sub = foreach sub generate sub.'ActivityDate_Year~~~ActivityDate_Quarter' as 'ActivityDate_Year~~~ActivityDate_Quarter', coalesce(sum(sub.'New Quarter Subcribers'),0) as 'New Quarter Subcribers', coalesce(sum(sum('New Quarter Subcribers')) over ([-1..0] partition by all order by ('ActivityDate_Year~~~ActivityDate_Quarter')),0) as 'Previous Quarter Subcribers'; result = cogroup sub by 'ActivityDate_Year~~~ActivityDate_Quarter' full, cancel by 'ActivityDate_Year~~~ActivityDate_Quarter'; result = foreach result generate coalesce(sub.'ActivityDate_Year~~~ActivityDate_Quarter', cancel.'ActivityDate_Year~~~ActivityDate_Quarter') as 'ActivityDate_Year~~~ActivityDate_Quarter', sum(cancel.'New Quarter Cancellations')/(sum(sub.'New Quarter Subcribers') + sum(sub.'Previous Quarter Subcribers') - sum(cancel.'Previous Quarter Cancellations')) as 'Churn Rate';



Thanks,
Pramod V
Siddharth Bhargava 7Siddharth Bhargava 7
@Pramod V - While creating a query/step please ensure you label it correctly 'Churn Rate'. Delete the existing one and creat a new query.. 
User-added image
Manish Yadav 44Manish Yadav 44
Would like to thank everyone on this thread for having such a valuable discussion.

Happiness
Peter Greenbaum 7Peter Greenbaum 7
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.
Analytics QuintoAnalytics Quinto
My most sincere congratulations @Peter Greenbaum 7
Arvind SaiArvind Sai
@LinThaw getting the error " Compile Error: Variable does not exist: ed_insights". Could you please help.
Rodrigo Jimenez RiosRodrigo Jimenez Rios
The same here! " Compile Error: Variable does not exist: ed_insights" Any help please??
Jim Taber 2Jim Taber 2
Stuck on challenge 5, step 3, "Connect Einstein Discovery to Your Custom Fields" 

When I go to Setup and type 'develop' in the search box, nothing comes up.  So I looked for 'Custom Settings' and that brought up a page, but there are no listings.  Not sure where to go from here, any suggestions?

Regards,  
Rodrigo Jimenez RiosRodrigo Jimenez Rios
Hi Jim Taber 2, 

Thats is because you have to install the Einstein Discovery Prediction package before, then go to Setup -> Custom Settings and right there is going to show you the "Einstein Discovery - Write Back" record, where you can edit and manage it. From there is where you have to follow the steps written by LinThaw in this thread above but still i can't complete the challenge because is show me the bellow error: "Challenge Not yet complete... here's what's wrong:
We couldn’t find the correct information associated with Apex trigger named SetDealPrediction. Confirm the Salesforce object and integration name." I think i am not able to call ed_insights from the trigger and i don't know why... Some help?
victor mitra 17victor mitra 17
I am completely stuck in the Step 4 of this challange,marking the chart step
I am getting this error 




"Challenge Not yet complete... here's what's wrong:
We can't confirm this is the state with the lowest CSAT or we couldn't find your result. Make sure a marker was added to your chart. Evaluate how the two datasets were grouped, and which fields were used. Also, confirm the chart is sorted by CSAT in ascending order.
Close errors"



I have done till the treemap chart,how to do the next steps

and I thank one and all for providing steps with explaination,it has helped immensly atleast till now!
Chris Price 28Chris Price 28
@Rodrigo Jimenez Rios where you able to correct your error? I too get it.
Error:
Challenge Not yet complete... here's what's wrong:
We couldn’t find the correct information associated with Apex trigger named SetDealPrediction. Confirm the Salesforce object and integration name.

All is working, when editing a Subscriber record the fields get values.
 
Akhil SattirajuAkhil Sattiraju
Hi All,
I am Struck at Step 2 of  Einstein Analytics and Discovery Insights Specialist.I am new to the binding concepts and I am not able to understanad what should we do next .I have created a rating chart calculating Churn/total no of Subscribers .Please help me from this step.

Chart
q = load "Beattie_Subs";


churn=filter q by 'Churn'=="Yes";
churn=group churn by all;
churn=foreach churn generate count() as 'Churn Subscribers';

q = group q by all;
q = foreach q generate count() as 'Total Subscribers';

result=cogroup churn by all,q by all;
result=foreach result generate sum(churn.'Churn Subscribers')/sum(q.'Total Subscribers') as 'Churn_Tenure';