0 Replies Latest reply on Feb 15, 2016 5:53 PM by Stephen Hellyar

    Function for Dashboard, Not Sheet

    Stephen Hellyar

      I need help with a simple function.  This function is taken from a Tableau API example.

       

      function yearFilter(year) {

      var sheet = viz.getWorkbook().getActiveSheet();

      if (year === "") { sheet.clearFilterAsync("Academic Year");

      } else {

      sheet.applyFilterAsync("Academic Year", year, tableau.FilterUpdateType.REPLACE);

      }

      };

       

      It does not work with a dashboard.  I get the following error message:

       

           TypeError: sheet.applyFilterAsync is not a function. (In 'sheet.applyFilterAsync("Investment", investment, tableau.FilterUpdateType.REPLACE)', 'sheet.applyFilterAsync' is undefined)

       

      How do I modify this function to work with a dashboard. 

       

      Thanks