Tableau filter based on multiple parameters? - tableau-api

I have some data like this below
data image see link
I would like to make a dashboard that will show you all the related empires based on what you choose (those that existed at the same time AND those in one of it's regions of influence). For example if I choose Rome then it will only show Egypt, Greek and Gaul and not show Byzantine because it is from a later time and not show China because it is in a different region. See below
See expected result picture in link

The simple way to achieve this task is to "Self-Join"
I would self-join the data again with Inner join on Region and Era
then, to handle the duplicate rows I would create a calculation
[Empire_Data1] = [Empires_Data2]
and put as false in the filter shelf.
then if you drag both Empires field you will the output you are looking for,
Since this is like 20 rows of data, you can perform a self join without any challenge.
But you have a lot of rows as in hundreds of thousands or more then, you might want to prep your data before connecting to the tableau.

Related

Tableau make one line out of two if same city name

Does anyone know if I can add two rows together so that I end up with just one row in Tableau (see screenshot)? So, if both rows are city Aachen and one row has a value for cost but not for purchasing power and the other row has a value for purchasing power but not cost, I would want just one row with both values. I am not interested in the columns "Table Name" and "Document Index(...". Thankful for any help!
Manipulating data like that in Tableau is usually no-go. Nevertheless, you can try Tableau prep and you should be able to do what you need here. Or maybe a different tool (even excel).
With that said, even though you have the info in two rows, the default approach for Tableau is always to aggregate data, so even if you have many rows with similar cases, once you take it to a viz using City (for example) as a dimension, this issue shouldn't really matter.

How to sum two different group by calculated fields in Tableau?

I have two calculated fields (HomeScore, AwayScore) and I grouped them by different dimensions(Home, Away). Now, I have TotalRuns per Team both in HomeGames and AwayGames. My problem is that I want to find the sum of TotalRuns per Team not separetely for home games and away games. I want to add these group-by fields somehow. I attach a screenshot to see my work. For example first column for both charts is "Arizona Diamondbacks" which has 263 Runs in first chart and 337 in the second one. I want to show the 263+337=600 Runs. Any Idea?
You'll want to create a LOD expression.
{FIXED [Team Name] : SUM([Total Runs])}
Think of your data as a big table (which it technically always is in Tableau). Every grouping, filter, etc. that you do narrows down the number of columns and rows you have left until you are left with your data set that contributes to your chart. LOD expressions allow you to back out of the filters, etc. in your calculation. In this case, you narrowed down to home or away games, and we are backing out of that to get a bigger picture of the data.

How can I create filters on a series of tables where the final table yields a single data observation?

I am creating an interactive 'calculator' using tableau. I have a series of dataframes that I have crossed with one another, such that the resulting dataframe is every possible combination between the tables, and every row is unique.
Each column is its own worksheet as a table. Each table in the dashboard is a pane. So, here we have a series of tables with selectable units of measurement, and the final pane on the dashboard should filter to the cell for its respective column, on the unique row of the dataset that the user has selected and 'filtered out'.
I'm having some issues getting this to work and not sure why.
The closest I can think to solving this would be 'Cascading Filters.' Here are a couple resources:
General Use
In dashboard action-filter form
The critical piece, however, is that the filters must be selected in a specific order - therefore making them 'cascading.' This may differ from your presumed concept of clicking/filtering in any order on the worksheets to then arrive to a final answer. I do think that this may be a limitation of Tableau - I don't think that a 'many to many' type of relationship can be set up within Action Filters.

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:

Using both counts and averages in tableau

I've got some data that I'd like to display both the averages and the count for.
For instance, there are 50 People taking a survey. Their names are saved in a Dimension "Raters". They are taste testing several products. These products are saved in a Dimension "Products"
They answer 4 questions. Taste, Texture, Appearance, Uniqueness, all saved in Dimension "Question"
The actual ratings are saved in "Ratings". This is a measure.
I can very easily make a table with Raters on the Rows, Question on the Columns, AVG(Ratings) in the text.
This shows me the average score for each question the rater answered.
It looks like this:
Rater-----Taste-----Texture-----Appearance-----Uniqueness
Joe---------2.2---------4.3--------------3.7-----------------2.4
Bob--------3.0----------1.2-------------3.4-----------------4.4
Sally-------4.5----------3.3-------------4.5-----------------3.2
Jessica---5.0----------3.0-------------2.0-----------------1.0
So far, so good.
Jessica's results look suspiciously integerish. When I look at the background data, I see that she only answered for 1 product.
I'd like to be able to add a column to the right of uniqueness which is the count of all product responses for that person.
I've played with this quite a bit, and I'm not sure that it is possible. Maybe with LOD?
I'd also like to filter the table, so that only "tough" raters are shown. Criteria for this is: Their average response for at least two criteria should be below 3.0. That would include Joe and Jessica.
When I try to do counts based on averages, I run into the "cannot aggregate an aggregate rule".
Is there a way around this? It would be trivial to do in excel with another column, a countif, and a filter.
Thanks,
Chris
Part 1:
You should be able to create a calculated field(Analysis->Calculated Field) and name it something like "Number of Records". In the query box just set it to 1 and select "Okay".
This new field will be selectable in the measures. Drag it into your table in the columns area and it should add a count next to your averages.
Part2:
In your measure values box you should be able to right click you measures. This will bring up a list of options including "Filter". Select this option.
On the SUM(Number of Records) set it to "At Least" = 2. Then right click on the AVG(Ratings) measure and set it to "At Most" = 3
Put Products on the Rows shelf.
Then right click on that Products field on the Rows shelf and change ITT from a dimension to a measure. Be sure to choose Count Distinct for the aggregation.
Finally, right click on the field again and change it from continuous to discrete.
This shows how many different products each person reviewed, no matter how many characteristics they rated. If you want the number of ratings, use count instead of count distinct. Or just Sum(number of records), again set to discrete