Tableau: store a dimension across 2 different views - filtering

I have two views within one dashboard. In view 1, the user selects one or multiple brandnames from a filter. Each brand belongs to a certain sector, which is also a dimension. What I need is, that the second view only shows those sectors that belong to the selected brands, but in this view the filter of the brand name cannot be used! This is because the second view shows the same measure, but from a higher aggregation level (countrylevel instead of brandlevel).
So I would like to 'store' the associated sector from view 1 separate from the brandname, so that I can re-use it in the second view.
How would I do this?

In your second view you want to pass Brand, which you say is the grain of first view.
So to achieve that you must put Brand in the level of detail of the second sheet.
Then you should create action filter with 1st view as source and second view as target.
Pass Brand as the value from 1st to second.
If you want quick filter, then both the view should be from the same data source. Apply Brand filter to all sheets even if the aggregation level is high it would filter the view.

Related

How can a Tableau Server user change the axis view on a granular table?

I am creating a capacity dashboard that has a granular aspect with multiple rows on the axis. The purpose is so that the user can see the specific view as the fields get more specific, such as Region to Market to Territory. My main problem is if there is a way for a user on Tableau Server to be able to edit the axis (maybe through a filter) so they could basically scale back the granularity a little bit. I know that in Tableau Desktop, you can just remove the dimensions, but I am hoping there is away to do that as a user in Server. Here are some pictures of my
workbook for examples:
You can see that when Territory is removed, it get less specific and shows all of Canada as a whole, grouped together. I am hoping there is a filter view or some way a user could change this dynamically. I have created a parameter with strings that matches the row dimensions that maybe when selected, will show up to that row, but I am not sure how to link that into the dashboard. Here is a picture of that:
Thank you for any help!
The best way to do this is to create a Parameter with your three Axis choices. It should look like this:
Next, create a calculated field that only references the Parameter like this:
Next, you will create three separate sheets. On each one, add the Axis Filter to the Filters Shelf. One each separate page, select one of the three values in your Parameter. (Tip - if the value doesn't show up you can either change the parameter or type it in manually under "Custom value list".)
What this does is create a filter whereby only ONE of the sheets will show up at any time. Meaning if you want to work on the Market sheet select the Market value in the Parameter.
Finally, to bring it all together, you will put these on a dashboard. Create a new Dashboard and add a Horizontal (or Vertical, it doesn't matter) Object (aka layout container) onto the dashboard. Put all three Sheets inside the layout container. You will see only one will be displayed but all three will have headers. On each sheet, click on the header and check "Hide Title" like this:
Finally, click on any downward triangle and show the parameter:
Now, by changing the parameter your user is selecting from three different sheets... effectively letting them change the Axis.
You can also view this documentation on the Tableau Help site.

Tableau - Filter View Based on Different Variable

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.

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.

Tableau Hierarchy Filter for Scatterplot

I am very new to Tableau, and I am trying to create a Scatterplot which can be viewed at different levels within the Hierarchy on the same Dashboard. For example, suppose I have employee counts, company counts and population density and I have this information by city, and these cities are in certain states.
I would like to be able to view the ratio # Employees/# Companies along the x-axis, population density along the y-axis, and I would like the ability to have each city shown as a separate bubble, and be able to, say, filter on Maryland, and show only the cities within for Maryland. This is all very straightforward using two quickfilters.
I'd also like to be able to somehow allow the user to specify that they want to see the bubbles at the State level, and once they select that option, it no longer shows the bubbles by city, it has aggregated those bubbles and is showing them by State. How do I do this?
Thanks!
Well, that is very easy to do when you are editing the view (just drag the field to detail and use the collapse option), but not so easy to provide this option to users.
I can think of a little hack. Create a parameter named [Level]. Make it a list of values, like 'City' and 'State'.
Now create a calculated field [Level of detail]:
CASE [Level]
WHEN 'City' THEN [City]
WHEN 'State' THEN [State]
END
I'm assuming your city and state fields are named [City] and [State].
Now drag this [Level of detail] field to details, and let the user choose the parameter. When he chooses 'State', it should aggregate on State level. Same for City.
One approach is to create a hierarchy out of the City and State fields.
To do that, in the data pane on the left, drag the City field and drop on top of the State field. You should get prompted for a hierarchy name of your choice, and then see the two fields grouped together in the data pane underneath the hierarchy name. State should be above City, but if not, just drag into the right order.
Now drag state to the detail shelf and build your view. Note there is a + sign to the left of State on marks card. You can press the + to expand the hierarchy and drill down to the City level. Then you can hit - to roll back up.
Custom hierarchies work for all kinds of discrete dimensions, not just those with geospatial roles.

How to display two grids with different data on the same form

I have a form with two grids. I have one table with rows where each row has a status of Yes or No. I'd like to display all the yes's in the top and the no's in the bottom grid.
A similar scenario would be if I wanted to show SalesTable header records. The top grid would be only those with a status of Delivered, and the bottom grid those with a status of Invoiced.
How can I accomplish this?
I've gotten close by adding another datasource of the same table type. I add a QueryBuildRange to filter the records but I get two issues:
When I click on a row in the top/bottom, it moves both row lines at the same time (the highlighting thing
It wants to show an equal number of top rows as bottom rows for some reason?? If I have 3 delivered sales orders, and 5 invoiced sales orders, it will show 3 in the top and 3 in the bottom.
Seams like the Grid-controls are being controlled by the same DataSource.
Check the properties of the Grid-control: make sure they are not set to the same DataSource!
Anyway, it would be helpful to know how the Form is structured and how the QueryBuildRange was added.
I created a very simple Form and it worked correctly:
added two Datasets with T-SalesTable each
added two Grid-controls to the Design (or to a TabPage, both worked)
adjusted the DataSource-property of each Grid to point to each DataSource
added fields (the AutoReport group) from the corresponding DataSource to each Grid
this one worked correctly (despite having the same contents. Then I
added a range in the init method of each of the Datasets
and it still worked.