Grey
Grey

Reputation: 147

Filter data with parameter tableau

I'm trying to filter data with parameter based on user_id with tableau. There's 3 columns: user_id, content_team, seconds. Some of the sample datas are:

 user_id | content_team | seconds
    1    |     AR       |  2030
    2    |     VR       |  1020
    1    |     AR       |  1500
    2    |     VR       |  3000
    3    |     HOLO     |  2230

Right now I have the sum(seconds) of the content_team for all the users combine

enter image description here

How can I create a parameter in which it takes a user_id and display the sum(seconds) of the content_team for that particular user only? Thanks

Upvotes: 0

Views: 429

Answers (1)

matt_black
matt_black

Reputation: 1330

The use case for using parameters in filters is usually that you have more than one data source that are not joined but do contain a common field. There is little benefit to using parameters when there is only one data source as simple filters work better.

But when you want common filters across multiple sources, can't join them into a common source, but don't want to lose some of the functionality in each sheet, then parameters work.

Say you have multiple data sources at different levels of detail but containing the same filterable field say user_id then you can create a parameter built on that field (and recent versions of Tableau can automatically update the content of the parameter on loading the workbook). The way to filter across the sources is to create a parameter called, say, user_id_parameter which is updated when the workbook is opened and then to filter each individual sheet using a calculation eg [user_id]=user_id_parameter where the user_id in each case is from the relevant data source. then, when the parameter is changed, each separate data source will be filtered to show only the data with that user_id even across multiple otherwise unlinked data sources.

This functionality (now that parameters can update on load) vastly simplifies the process of creating "universal" filters that work across multiple data sources in a workbook.

If you only have one data source, the technique still works but has little to no advantage over just filtering on the relevant field (and, don't forget, you can set a filter to apply to all sheets or a range of specified sheets).

Upvotes: 1

Related Questions