Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the data of a filtered datasource

I'm applying a filter on a datasource and I want to retrieve all the filtered data from this datasource.

The filter is correctly apply, my DropDownList is displaying only the filtered item, but when I want to get the data with Javascript, i'm retreiving every data and not only the filtered one.

Here is some code :

dropdownProduct.dataSource.query({ filter: filter }); 

var data = dropdownProduct.dataSource.data();

In the data variable I have all the data. Like I said, the query is working because my dropdown is only displaying the filtered data.

What can I do to only have the filtered data in the data variable?

like image 609
Marc-André Bilodeau-Lamontagne Avatar asked Jan 07 '13 19:01

Marc-André Bilodeau-Lamontagne


People also ask

How do I extract filtered data from Tableau?

Click on the "Edit" option that placed on the top right corner near to Extract button. It opens the "Extract data" window. Click on the "Add" option present in the Window.

How do you filter or get specific data from outcome of data source?

To create a data source filter On the data source page, click Add in the Filters section in the upper-right corner of the page. To create a data source filter on a worksheet, right-click (control-click on a Mac) the data source and choose Edit Data Source Filters.

How do you link filters from different data sources in Tableau?

To apply the filter to all worksheets that use related data sources, right-click the field on the Filters shelf and select Apply to worksheets > All using related data sources.


1 Answers

This is because the filtering is applied on the client side - and the data method returns all the data. You need to use the view method to retrieve only the visible to the end user data.

like image 109
Petur Subev Avatar answered Oct 05 '22 15:10

Petur Subev