dynamic column in tableau based on quick filter selection - tableau-api

I would like to know if it is possible to create a dynamic column in Tableau that will change based on quick filter selection.
Example:
Tableau sample screenshot

Try using parameters to select the category. This will give you step by step directions.

Doing this is as simple as it looks.
Assuming that you're using a query to fetch data, make sure the column on which you want to apply filter is available in the select statement.
Next, go to Sheets and drag the field into Filters section, right click on it and select Show filter
The filter will be visible on the right pane and can be used to alter the data depending upon the values / ranges selected.
Also, filters on Tableau give you a host of options to select from - dropdowns, radio buttons, check boxes, sliders etc etc...

Related

How can I create a LOV where the user can select as many options as they want (like a series of checkboxes and select all that apply)?

How can I create a list of values (LOV) where the user can select as many options as they want (like a series of checkboxes and select all that apply)? I am only away of being able to select one option as opposed to selecting many, but please correct me if I'm wrong.
"The property you will attach the LOV to will need to be an array. Then in TC you can multi-select more than one value of the LOV."
Source: https://community.sw.siemens.com/s/question/0D54O00007DC6yWSAT/how-can-i-create-a-lov-where-the-user-can-select-as-many-options-as-they-want-like-a-series-of-checkboxes-and-select-all-that-apply

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

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)

Difference between two measure totals in Tableau

Using the sample-Superstore data, I am trying to do a table calculation on the row totals, Sum(Sales) -Sum(Profit). I can get the result using this formula
TOTAL(SUM([Sales]))-TOTAL(SUM([Profit]))
But it will also show the value under Ship date 2016/2017,(I only need the total). Any ideas on how to remove the highlighted portion or an alternate way to achieve this?
Try one of two:
1) Try right-clicking the column where your red box is, TOTAL(SUM(SALES))... and then un-check 'show headers'. That will remove the column from your viz, however the calculations and sorting will still be there.
2) Adding the measure-names manually, rather than with the 'measure names' blue-box in the columns. Then, right click the column you wish to hide, and uncheck 'show headers'. That will remove the column from your viz, however the calculations and sorting will still be there. .

Graph based on the user filter selection

On a tableau dashboard there are 2 filters and a bar graph.
The filters are 1. to select top or bottom customers
2. how many ex:5,10,15 etc
when the user selects top and 5 in the respective filters then top5 customers have to show in the bar graph.
if the user selects bottom ,10 in the respective filters then bottom 10 customers have to shown in the graph.
how to achieve this when the data contains only customers details and their billing amount ?
Instead of filter, you can go with the Parameter for getting the result. I have done the top and bottom multiple times in many of the tableau visualizations and its so easy.
Below are the steps to achieve your requirement.
Create a parameter that will allow you to select top and bottom
Create another parameter that will allow you to select the desired numbers like 5, 10, 15 etc.
Here i have created a parameter that will have values from 10 to 50 in a step size of 10.
Create a calculated field that will subset data based on the parameters chosen
In the above screenshot, I am using the top site parameter and creating a conditional statement that will show the states based on the value chosen in the site parameter and the value for that state.
Put the calculated field in the filter and select show and click ok in the filter box.
Now the view will show the top count based on the value selected in the parameter.
Please note the calculation is for top N and for bottom N you need to change the calculation.
Hope this will help you. I can provide you a workbook if you need.

Group by first two characters of column, in Tableau?

I'm using Tableau Desktop v9.0. I have data that looks like this:
code,items
02050252,7
03040620,19
03060423,3
I want to create a bar chart of the items grouped by the first two characters of the code field.
So effectively a chart that shows this underlying data:
new_code,items
02,7
03,22
Is it possible to do this within Tableau? Or do I need to group the data manually myself first?
You can definitely do this within Tableau.
Make sure that your code column is a string. If it's not, right click on it in the dimensions section and choose Change Data Type.
Then, create a calculated field (Analysis -> Create Calculated Field) and enter the expression LEFT([Code], 2), which will take the first two characters of the code field.
Drag your new_code field to the Rows shelf and Items to the Columns shelf and voila, you have your desired data. You can of course change the type of the chart, make it a table, etc. from here.