The provided link has been updated, it no longer requires an ID or password.
Doug, as Jordan indicated, you create a formula specifically for your variable, $Apple$. With that in place, you can connect a filter to it, or just a view parameter, and use a script to change the values. In the sample Jordan provided, Yearly Contribution is a variable, which you change with a script:
//pick up the selected value
var selection = slider3.valueFirst;
//label1.labelText = selection;
//get the parameter to setup
var viewParameter = dundas.context.baseViewService.currentView.control.viewParameters.toEnumerable().first(function(vp) {
return vp.name === "viewParameter1"
});
//setup the parameter value and ensure the token like "all" is null
viewParameter.parameterValue.value = selection;
viewParameter.parameterValue.token = null;
//refresh all the controls bind to this parameter with the new parameter value
viewParameter.refreshAllAdapters();