Tableau | Display different sheets by selecting option(s) from one particular filter - tableau-api

Is there a way to display different sheets by clicking/selecting values/options from one particular filter?
for example, if I have this filter:
and I need to display a sheet named Departments when I select Commercial from the filter shown in the PtrScn.
However, When I click/select any other options like HR, Information ...etc, I want it to display the associated sheet with the filter "Filter by Sector"
Any hints would be highly appreciated!
NOTE: I use tableau 2019.1 and it does not show "Change Parameter" that might be needed to approach this as I noticed when I have been researching for two days now!

You should use a container (say vertical) where you wanna put your N worksheets one on top of the other one without changing vertical spacing: just let Tableau do its stuff!
Be sure to remove the worksheet titles.
Once you're done, you need to create a parameter in order to handle all the N possible choices, and according to that you need to create N Calculated fields with a condition like this one:
if [Param] = 'Profit' then 'ok' else 'ko' end
Each calculated field will be used as a condition (select just ok values) in your filter selection.
Since the parameter can accept just one value a time, you will have just one of your N worksheet displaying data.
And this is the trick based on the vertical conatiner: if you hide worksheet titles, you will see "something" just for the selected worksheet and Tableau automatically will handle all the vertical space in the container.
The result will look like the following:

Adding to Fabio's great answer, these resources about collapsing containers may be useful:
Sheet swapping using collapsing containers
Automatically resize items in a Tableau container (or make disappear in your case)

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 Desktop Filter Disable/Enable

Working on Tableau desktop[Making a visualization] have two filters one cascaded to another.Need a help when making multiple selections in one filter should disable another filter. If one selection is made in a filter then other filter should be enabled and shown.
Looking for answers
Tableau graph
You could solve this in a dashboard using the sheet/object swapping and popping technique as explained here. Basically how it works is having a dummy sheet which is empty on a certain condition but which will have values if not. The parameter will be placed below this sheet which results in it moving downwards/upwards whenever the condition changes. Together with a motionless opaque text field it becomes possible to hide the filter. I tested the solution underneath.
You will need a calculated field hide_names which results in True if the condition is filled. In your case:
if COUNTD([Manager]) > 1 then False else True end
Next create a dummy worksheet which you will fill with another calculated field which does almost nothing e.g. 'a'. This sheet will be used to 'pop out' the filter in your dashboard. To have this functionality you need to drag the newly created hide_names into filters and filter on the custom value False.
Now let's look at the dashboard.
First bring in the original sheet together with the relevant filters.
Right click the manager filter and select "all using this data source". This way your dummy sheet will also be aware of changes in the filter.
Then create a horizontal floating object in which you need to drag the names filter. On top of the names you need to drag the dummy sheet so if the sheet is active it will push down the second filter.
What you should have now is once you select more than one manager a sheet containing 'a' is shown and the second filter is pushed down. This is not ideal. You will need one or two more things depending on the actual lay-out of your dashboard.
You can make your dummy sheet entirely white by changing the format so all rows/columns/text display white, disabling the tooltip and removing headers and titles.
Create a new empty floating text object. Right click on it and select format text object. Select white shading for this object. This way it becomes opaque. Drag and change dimensions of this object so it hides the second filter whenever the dummy sheet is shown.
Once you have all of these elements you can sort of play with it to make it work. You can find a demo of a dashboard with similar but not exactly the same functionality here.

Tableau add formula to dashboard action filter?

I've got a workbook I'm building using public data https://public.tableau.com/profile/alee4645#!/vizhome/JSAClaimantsWardtimeseries/Dashboard1
The basics are working as I want, you see the map, you click on one of the coloured areas and a time series chart appears below the map showing the change over time for that area.
I want to add a couple of comparisons to this data, for example I want the time series chart to show a line for the whole coloured area (Somerset) so people can see how one part of it compares to the overall average.
I have the figures as separate rows in the data but of course when the action filter is triggered they get filtered out along with everything else.
If I edit the action filter in the filter shelf for sheet 2, it has the condition tab and I was hoping I could add [ward code] = "E10000027" (the comparison data I want to use) to the formula box so it would also keep the relevant rows of data, but that stops the chart working altogether.
I could achieve it by getting people to choose an area from a parameter drop down but I'd rather let them click on the map so they don't need to know the name of the area they are interested in.
Can this be done?

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.

Show calculated measure in row?

I'm using Tableau Desktop 9.0 on OSX. I have data (loaded from a local CSV file) that looks like this:
code,org,items
0212000AA,142,10
0212000AA,143,15
0313000AA,142,90
0314000AA,143,85
I want a chart that shows the number of items beginning with 0212 as a percentage of all items, for each organisation. (I mean as a percentage of the organisation's items - for example, in the above, I would like to show 0.1 (10/(10+90)) for organisation 142.)
I have been able to get part way there, by adding org to Columns, and SUM(items) to Rows. Then by adding a Wildcard filter on code, for starts with 0212.
This shows me the number of items starting with 0212, by organisation.
But what I don't know how to do is show this divided by the value of all items for the organisation.
Is this possible in Tableau, or do I need to pre-calculate it before loading my data source?
One way is to define a calculated field called matches_code_prefix as:
left(code, 4) = "0212"
You can also define a parameter called, say, code_prefix to avoid hard coding the prefix string:
left(code, 4) = code_prefix
And then show the parameter control for code_prefix to allow the user to interact with it.
If you use this new field as a dimension to separate SUM(items) according to those that match the prefix and those that don't, you can then use a quick table calculation to get the percent of total.
For example, you can place org on the Rows shelf and matches_code_prefix on the Columns shelf, and SUM(items) on the Text shelf to make a table. Then under the analysis menu, turn on grand totals for both rows and columns to see the behavior. Next, right click on SUM(items) and choose Quick Table Calc->Percent of Total. Tableau will display the percents of total in the table.
If you want the percent of total defined differently than the default, then right click on the measure again and set Compute Using to a different value such as matches_code_prefix in your case. It's usually better to set compute using to a specific field.
If you only want to display the value for the matching case, select the column header you don't want to see and choose hide. You can also turn off the grand totals from the analysis menu when you are done.
When you are confident in the values in your table, you can turn it into a bar chart for example by moving matches_code_prefix to the detail shelf and the measure to the Columns shelf.
--
The above is the drag and drop approach. If you prefer to hard code everything in a single calculated field that is calculated on the database side, you could instead define a calculation such as:
zn(sum(if matches_code_prefix then items end)) / sum(items)
Then set the default number format for that field to display as a percentage