0 Replies Latest reply on Jul 5, 2015 6:28 PM by Alex Martens

    Help recreating a filter!

    Alex Martens

      For an upcoming project, I am iterating over the filters from the report in the JavaScript API Tutorial and then attempting to recreate all of the applied filters. This is the report itself:

      http://public.tableau.com/views/WorldIndicators/GDPpercapita


      The filter I am having trouble recreating is when I select one or more of the bars in the chart and then click "Keep Only". When I iterate over the returned filters from getFiltersAsync, I get a categorical filter named 'Inclusions (Country / Region,Region)'. I get this name from getFieldName. I am trying to, preferably, recreate this filter setting upon instantiating a new Viz object:


      var options = {

      ....

        'Inclusions (Country / Region,Region)': 'Bermuda,Luxembourg,Norway'

      ....

      }

      viz = new tableau.Viz(placeholderDiv, url, options);


      or, alternatively, by calling:


      activeSheet.applyFilterAsync('Inclusions (Country / Region,Region)', 'Luxembourg', tableau.FilterUpdateType.REPLACE);


      But, neither one seems to work. What am I doing wrong?


      Thanks,

      Alex