How do I find the average age of users based on value of another column? - tableau-api

I have a dataset for health procedures with each patient listed under Index_Num. Most patients are listed several times as they have had several services. There is a column with their age.
There is another column called Portal_Use, which says "Yes" or "No" based on whether the user is a portal user.
The question I am trying to visualize in Tableau is the Average Age of Portal Users.
I created a group of the Index_Num, but don't know where to go from there. I'm essentially looking for a bar chart that has one bar for portal users and one bar for non portal users with the average age. This would be very easy if there weren't multiple rows per patient.

Based on your explanation I have used below data to generate the sample workbook.
Use your Portal_Use flag as a Columns
Add Age as an AVG value in Row section
From Show me section select the Type of Bar char you needed
Above will give you desired results as per below.
I hope this helps!!!

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.

Static column in tableau but rest all columns dynamic with filtering

I am building a tableau dashboard which has month, region, and account type filter. (Account type can have only two values either New account or old account)
The table in the report should have the following columns:
Month,
Region,
Clicks,
Signups.
Now the issue is clicks are independent of the account type and signups is dependent on the account type.
I am required to create a static clicks columns i.e when a user filters on account type then only signups column numbers change but clicks remain the same.
I have tried multiple ways to create this table but I am unable to reach a solution to this. I also tried creating two workbooks- one with just a clicks column and the other workbook with rest of the columns. After which, I pasted them together side by side in a dashboard. But the formatting looks extremly off and not professional.
Could you please guide me as to how I can achieve this?
You can use a level of detail expression. These are calculated prior to any dimensional filters and therefore will be unaffected by these actions:
Create a calculated field as follows:
{ FIXED [Month], [Region]: sum([Clicks]) }
This will calculate the sum of the clicks per month and region and ignore any filtering on account.
Let me know if this gives your desired result or if we need to refine further.

Sales vs Profit Dashboards in Tableau

I'm trying to achieve a viz in Tableau in which If I click on a paramteer value called sales then sales viz should be selected and if I click on parameter value Profit, then profit viz should be displayed.
Can this be done using parameters in the first place?
Or Action filter is the only option?If action filter is the option can I make sure that If I select one parameter say Sales then the other Viz should be hidden automatically.
I found this link in the tableau training tutorial which might be useful for you.
https://www.tableau.com/learn/tutorials/on-demand/advanced-training-parameters
Steps to follow.
1- Create a parameter with data type "string" which will display either Profit or Sales as values.
2- Create a calculated field with case when function to link your parameter to the measures you want to use (in your case sales or profit).
CASE [Parameter - Sales or Profit]
WHEN 'Sales' THEN [Sales] ## assuming your sales dimension is sales.
WHEN 'Profit' THEN [Profit] ## assuming your profit dimension is profit.
ELSE 'Others'
END
This link would be helpful http://onlinehelp.tableau.com/current/pro/desktop/en-us/help.htm#changing-views-using-parameters.html
3- Build your graph
4- Show Parameter control (the one you created in the first step).
Every time you update the parameter, the graph will be updated.
Hope you find this useful.
A simple solution is to put measure values on either the row or column shelf; and measure names on the filter shelf. The show the filter control for measure names.
The downside is that people can choose other measures that you did not intend to expose
Yes, you can do it with parameters. You use a layout container to hold each sheet and then the parameter will filter one and not the other.
See this post for details. http://www.bfongdata.com/2014/10/chart-creation-with-parameters.html

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:

Tableau, color-coded bar chart not working

Public workbook here. Source is Excel file.
I was able to create ordered bar chart based on (1) Location (2) Product
When I drag Above Three into Color, the graph is incorrect, how to troubleshoot?
Update
I made change such that Calculation computers based on Product, Above Three for each Location, at level Product.
However, Morton's still shows error.
The order in Mortons should descend, based on number of records, i.e.
Dark Chocolate
Beer
Toffee
Coffee
Fries
Rest of the Locations are correct, but only Mortons gives out-of-order products
Update2
Calculated Field Calculation3 = Index()
And I filter Calculation3 for 1 to 3, to display top 3 products
If I remove Calculation3 from filter, it gives correct order but it give ALL products, not the top three popular products (per Location).
I updated workbook to illustrate this. Please advise.
I don't know the purpose of the Index() field but that is creating your issue. Remove it from rows and the color appears to work the way you want it.
I hope this is what you are looking for
I have also published the file at the below address. You can take a view on that.
Tableau Wokbook
I achieved it by the following methods.
I changed the Calculation 3 field from Index() to RANK(SUM(NUMBER OF RECORDS)).
The calculation 3 was kept in between Location and period then edited the table calculation of calculation 3 by keeping the Addressing of the edit table calculation, having only the location and product as shown below and then Set the restarting every to Product.
You can check the workbook for more information