1 Reply Latest reply on Sep 18, 2019 2:56 PM by Geraldine Zanolli

    Apply a Range Filter to a Dashboard Worksheet Before Loading the Visualization

    James Rader

      Hi,

       

      Using the JavaScript API, I am successfully filtering an individual worksheet on a dashboard from an input box like this:

       

      var minVal = $('#textFilter').val();
      
                  var worksheet = viz.getWorkbook().getActiveSheet().getWorksheets().get("MyWorksheetName");
                  filter(worksheet);
      
                  function filter(worksheet) {
                      return worksheet.applyRangeFilterAsync("SUM(Number of Records)",
                          {
                              min: minVal
                          })
                      }
      

       

      How can I filter the same way on initial page load (before loading, of course)?  In the documentation, the only pre-load example I see is this:

       

      var containerDiv = document.getElementById("vizContainer"),
      url = "http://YOUR-SERVER/views/YOUR-VIEW",
      options = {
          "Container": "Boxes"
      };
      
      viz = new tableau.Viz(containerDiv, url, options);
      

       

      In 'options', how can I specify the worksheet, and how can I filter on a range?  I've been guessing on syntax for a while now, and can't get it right.

       

      Thank you in advance!

       

      -James