TAGS :Viewed: 3 - Published at: a few seconds ago

[ Download all the filters from tableau workbook ]

We built a tableau workbook and planning to move them to production soon. As part of deployment, we need to document all the filters used in the workbook. Is there any way, I can extract all the filters used in a workbook or configurations done in a workbook? Like an API or any other options to get all at once? Because, we have more than 100 sheets and its really difficult to open all, read and document it manually.

Thanks in advance.

Answer 1


Here's the Javascript API to query for all filters in the worksheet. 'Flights' is the sheet name

function getFiltersAsync() {
            // Get first worksheet in book
            var worksheet;
            var filtersVal='';
            var onSuccess = function (filters) {
                $("#lblFiltersCount").text("This worksheet has " + filters.length + " filter(s) associated with it.");
                $.each(filters, function (filter, i) {
                    // use .value property of each DataValue object
                    filtersVal += i.getFieldName() + ", ";
                    $("#lblFilterField").text(filtersVal);
                });
            };

            var onError = function (err) {
                alert("Whoops");
            };

            viz.getWorkbook().activateSheetAsync("Flights").then(function(sheet) {
                worksheet = sheet;
                worksheet.getFiltersAsync().then(onSuccess, onError);
            });
        }

Answer 2


Sharing the answer as anyone might require this in future.

http://community.tableau.com/message/358767#358767

Here is the code if anybody wishes to use this.

http://pastebin.com/bruVTSmN