I am trying my had at the JavaScript API Tutorial that tableau provides. When I got to the filter portion I got a little lost and was hoping for some guidance. I have created a fiddle and trimmed down the code to the bare minimum:
var placeholderDiv = document.getElementById("tableauViz");
var url = "http://public.tableausoftware.com/views/WorldIndicators/GDPpercapita";
var options = {
hideTabs: true,
hideToolbar: true,
width: "800px",
height: "400px",
onFirstInteractive: function () {
workbook = viz.getWorkbook();
activeSheet = workbook.getActiveSheet();
}
};
viz = new tableauSoftware.Viz(placeholderDiv, url, options);
function filterSingleValue() {
activeSheet.applyFilterAsync(
"Region",
"The Americas",
tableauSoftware.FilterUpdateType.REPLACE);
}
When I run the consol debugger, I get the following error:
"Uncaught ReferenceError: filterSingleValue is not defined "
I am not sure what that means, but I am guessing that the filterSingleValue() function isn't actually passing any data. Is it because I don't have the first part wrapped in a function?
My goal is to just have my filter button filter on "The Americas" region. Appreciate any guidance or suggestions. Here is my fiddle