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 2: How can I get my toggle binding to work?

I am still struggling with the Einstein Analytics and Discovery Insights Specialist Superbadge (, step 2.

Finally my chart is displaying and my toggle switches are displaying, but the toggles are not functioning as expected.

When I select any of the three risks (e.g. "Medium Risk") the chart disappears and is replaced with a a message:
Can't display this widget. More Details

When I display more details I see:
This widget can't be displayed because there is a problem with its source step:
The binding 'row(Tenure_Length_1.selection,[0],["min","max"]).asRange ("Tenure")' contains an error: The column name 'min' doesn't exist in the data.

However the following query seems to be working correctly:
beattieSubscribers = load "Beattie_Subs";
tenuredSubscribers = filter beattieSubscribers by{{row(Tenure_Length_1.selection,[0],["min","max"]).asRange ("Tenure")}};
churnedSubscribers = filter tenuredSubscribers by 'Churn' == "Yes";
groupedSubscribers = group tenuredSubscribers by all full, churnedSubscribers by all;
churnRate = foreach groupedSubscribers generate (count(churnedSubscribers) / count(tenuredSubscribers))*100 as 'churnRate';",

What do I need to do to make the toggles work correctly?
Deepali KulshresthaDeepali Kulshrestha
Hi Brian,

Greetings to you!

"query": "q = load \"Beattie_Subs\";\n
q = filter q by {{row(Tenure_Length_1.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';",

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks and Regards,
Deepali Kulshrestha
Mohammad AnisMohammad Anis

Use the below query as:

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';

Mohammad Anis