Tableau - Filter View Based on Different Variable - filtering

Is there a way in Tableau to filter a view based on its relationship with a different variable?
For example, say I have a dataset with variables Company (values = A, B, C) and Product (values = 1, 2, 3). In one view, I want to select a Product. In the other view, I want to filter to only Companies that have that Product, but I want to show all Products for those companies. The typical filtering approach in Tableau could easily show me which Companies have that Product, but the rows with other Products from the same Companies would be excluded by the filter.
Any solutions? I get the feeling I may be missing something simple.

Create a parameter to represent the product of interest. You can load the values of the parameter from the Product field, but will have to add/remove choices periodically as product list changes.
Place Company on the filter shelf, and use the condition tab to choose only companies that have that Product with a formula such as max(Product = [Product of Interest])
For more than one product at a time, create a set of Products instead of a parameter and change the formula to test for set membership instead of field equality. If you have a set of Products called [Products of Interest], note the plural, the formula is then simply max([Products of Interest])
The nice part about a set is that it notices changes to the database Products list automatically. The bad part about a set is that Tableau doesn't make it easy to add or remove elements from a set in the user interface unless you are using Tableau Desktop (at least not by version 10.1)

In addition to the methods explained by Alex, (if you are okay with having multiple sheets) you can have 2 sheets linked with an Action filter -
First sheet would just show the unique list of Products (this acts as the Source sheet)
Second source would contain whatever view you like to show with Companies and their products (this acts as the destination sheet)
Create an action filter between the 2 sheets and use the "Selected fields" under Target filters to filter using the Company field. This way, if you select any specific product(s) in the first sheet, all relevant companies would be filtered in the second sheet but all the products show up too!
EDIT: this is a good solution in many cases, but there are a few things to be careful about.
Note that the first sheet needs Company on some shelf, possible detail, so that field is available for the filter action. If there can be multiple companies per product, then that can complicate the viz a bit.

Related

Filemaker: display related records based on date

I have 3 tables,
Table 1:
Client
Table 2:
Followups
Table 3:
Referrals
It's a one to many relationship where one client can have multiple followup or referrals.
How do I display the Followups and Referrals between 2 dates?
I have a summary field which counts the total of each followup and referrals but they show me all the count rather than in between a given date
In your relationship graph make a new table occurance that restricts the related set based on a date range. Here is an example image. You can make "date one" and "date two" globals so that they are not stored, and operate across all records. Base your sum / count calcuations based on this relationship.
Otherwise you can use a sub-summary on your layout in list view, and place the Summary fields in the sub summary. The summary field will show the sum for that sub section.
Another option is to place the summary field inside a one-row portal and filter the portal to show only records within the desired range.
This requires much less resources than adding filtered relationships - but it can be slow if you have too many related records.

How to dynamically filter based on different column in tableau?

I have two columns site and Profit catgeory.
Site --> A, B, C
Profit Category --> 1,2,3 [ It will be calculated dynamically, when data changes]
Data:
I want to filter site based on profit category.
Workbook:
If I select Site A in filter option, it hsould display all the sites which is in same Profit category as Site A. If Site A falls under Profit Category 1 means all Sites wchich falls under Profit Catgeory 1 should be dispalyed.
I am struck with this. Please help me to solve this.
You need to display a parameter control instead of a filter control.
Parameters are used to hold the (single) response from the user for making a choice. You can reference parameters in many places, including calculated fields. You can then use calculated fields as a filter.
You can combine these features in different ways. In your case, I suggest creating a parameter based on the Site field. Showing the parameter control and allowing the user to select a site. Then building a boolean calculated field to determine whether a record should be included in the analysis or not based on the selected site and the data values in the current record.
Filter on that calculated field and you should be able to get the effect you described.

Top 10 and items upon user's demand

fellow Tableau Developer,
Take the super store database for example, it is easy to draw a histogram displaying the sales amount of each customer and to only display the Top 10 customers.
It is also easy to build a multiple dropdown filter to let the user to specify some customers at the user's will.
But, is it possible to combine the two of them, namely, to display Top 10 customers and in the same graph display a few other customers (possibly not in the Top 10) on the user's demand?
Here is a straight forward solution that works with Tableau Desktop, but not as useful currently on Tableau Server. The viz still works on Server, but you can can't alter the list of specific users on Server.
Here's the approach.
Create a set to represent your Top 10 customers -- a computed set. (right click on the [Customer Name] field, and Create Set)
Create a second set to represent your specific list of customers of interest -- a static set (select [Customer Name] and Create Set)
Create a combined set to be the union of both sets and place it on the filter shelf. (select both sets, right click and create a combined set)
Use your combined set on the filter shelf, row shelf, in calculations, as desired.
A desktop user can edit the Interesting Customers set. Sure wish there was a control similar to "show filter" for editing set members.
If you'd like this feature more flexible in Desktop, and even available on Tableau Server, upvote the following idea
https://community.tableau.com/ideas/5193

Displaying different sheets at user's demand in a single dashboard -- Tableau

I am new to Tableau. I am not sure if I can use Tableau to create the following type of interactive dashboard.
Say I have two almost irrelevant data sources. The first one contains daily revenue for some department stores.
Store Name Date Revenue
-----------------------------
Macy 6/29/16 50,000
Century 21 6/29/16 46,000
Macy 6/28/16 45,000
Century 21 6/28/16 48,000
...
I want to use line chart to study the Revenue. So I would use Date as the horizontal axis, and Revenue as the measure, while using Store Name as the color dimension. As a result, it will render several color lines to capture the revenue in terms of date.
For my other data source, it contains similar things. But instead of doing department stores, it contains information about fast food chain restaurants.
Restaurant Date Revenue
----------------------------
KFC 5/1/16 50,000
McDonald 5/1/16 46,000
KFC 5/2/16 45,000
McDonald 5/2/16 48,000
...
I use line chart to study the revenue again.
Now with the dashboard, is there any way I can have a control with menu Fast Food and Department Store, so that if the user clicks Fast Food, the line chart involving Fast Food appears and if the user clicks Department Store, the line chart involving Department Store appears?
So far, I've been able to use this helpful article http://kb.tableau.com/articles/knowledgebase/multiple-sources-one-worksheet to display Fast Food and Department Store at request. But if the user clicks Fast Food, he will get only one line, instead of multiple lines (one for each restaurant).
I hope I have described my problem clearly.
You can fairly easily do this using a parameter control and using it as a filter in your sheets.
First, create a parameter control "View Control":
Next, create a calculated field based on the parameter for each data source:
The calculation should match the data source ('Fast Food' for the fast food source, and so on)
Then place the calculated fields in the filter card and set to True. This should hide one of the sheets and show the other. They should never be shown or hidden at the same time.
Lastly, place both sheets and the parameter control onto a dashboard. It is best to place the two sheets within the same layout container. You should get the following result:
change parameter:

Showing comparison across groups in tooltip Tableau

I have a dashboard that lets users compare a company selected from a drop down menu (Company A) to another company chosen from another drop down menu (Company B). This then displays stacked bar charts (5 categories) by year. I want to build a tooltip so that when the user hovers over one of the 5 categories in either set of bar charts, it shows a comparison of that category between Company A and Company B. Is this possible, and if so, what is the best way to do this?
My previous answer showed a different approach for the problem without using too many workarounds. This answer will try to give exactly what has been asked.
First thing to understand is that you can't have the values for two different companies if you're filtering to show only one company. That means you'll need to circumvent this by filtering directly on the field.
Step 1: Create the new parameters that will be used as filters.
You want to create two parameters called "Company 1" and "Company 2" that will be used in each view to filter the company on the graphic.
Step 2: Create the new measures with the filter directly in the field.
Now you should create two new measures from your main measure, each one filtering one of the companies accordingly to the parameter, e.g. Sales Company 1 and Sales Company 2.
Step 3: Create a field with the variation and add it at the tooltip mark.
Simply enough, you want a calculated field with the difference between them:
SUM([Sales C1]) - SUM([Sales C2])
Step 4: Update the views and dashboard
Change the measure in each of the views for their following specific measure field, and remove the Company filter. And in the dashboard, substitute your usual filters to the parameter (which will be used to filter both views).
By assuming you have a dashboard with two views, you'll be filtering the [Company] in both of these views, making the value of another company not available to be shown at the tooltip.
If you're not using it yet, you could try a new approach and see the variance between companies by using the Color mark. By adding the [Company] as color, you could turn the Stack Marks off and add the second company in the filter to be able to visualize the difference.