Tableau: How do I calculate the proportion of one value as a percentage of another value, when the dimensions are in the rows - tableau-api

I'll lead by saying that I'm fairly new to Tableau and that I'm currently on version 9.1.
Here's the format of my data:
Date Color Fruit Value
1/1/2016 Red Apple 1
1/1/2016 Red Apple 2
1/1/2016 Red Pear 2
1/1/2016 Red Pear 3
1/2/2016 Green Apple 4
1/2/2016 Green Apple 2
1/2/2016 Green Pear 1
1/2/2016 Green Pear 2
How would I calculate the sum of Apples as a percentage of all Fruit? What about Red Apples as a Percentage of All Apples?
Please feel free to comment on how I can clean up this question, I know it's in bad shape. Thanks.

In order to show the % of a Total you should Right-click your measure and select Quick Table Calculation --> Percent of Total.
Example
Drag Furit on Rows and then Value on the Pane.
You should get:
Apple 9
Pear 8
Now you can add your quick table calculation and you'll get:
Apple 52,941%
Pear 47,059%
EDIT for Second Question
Dragging color in the rows shelf will update alle the %'s (of total).
If you want to see %'s by fruit, you just need to adjust the Computing type of your table calculation.
In order to do that, yo have to right click your measure and then click on "Compute Using" and then select Fruit.

Related

Highlight multiple row values based on another value in tableau

I have a table with 4 columns grouped by first 2 columns. Something like below
Company Department Department Rating Org Org Rating Emp Type Employee
A Sales 1 XX 2 External John
Ops 2 XX 1 Hybrid Mike
B HR 1 YY 2 Internal Richard
Dev 3 ZZ 3 Internal Julie
I want to highlight Department and Org based on values in ratings column (1- yellow, 2- red, 3-blue)
Could anyone guide on how to make it happen on tableau?
Tableau by default will only highlight measure values so in order to highlight dimensions you need to trick it a bit.
First, you'll want to create two dummy columns with the formula min(1). You can either create this through a calculated field or just double click and type them in the columns shelf.
In the Marks card for each of the two new measures (not the All card), place Department on the text field in one and Org in the text field of the other. Set the Mark type to be Text on both of them.
Create a calculated field to define the colors. The actual values don't matter here as you'll assign a color to them latter. Put this on the All marks card on the Color Shelf.
At this point, you might have something like...
Now to finish it off you can do a few things:
Double click on the color squares in the legend to reassign them
Change formatting on the measure to get rid of the axis, zero lines, etc
Move the label from the bottom to the top by creating a dual axis.

Tableau: Adding Red and Green arrows to a column

I have 2 columns that I have in Tableau and one of them is date (Column A) and the other one is survey answer ( Satisfied, not satisfied, no comment). On the survey answer column I would like to indicate its growth over date (column A) using red or green arrow. Any thoughts on how I can to do that?
have you seen this post by Jonathan Drummey?
http://drawingwithnumbers.artisart.org/older-but-still-useful-conditional-formatting/

How to Display ReportHeader Text label only once?

In the sub report
Fruit
apple 10x1 10
Fruit
banana 2x2 4
The label Fruit keeps on repeating how can I make it appear once
Fruit
apple 10x1 10
banana 2x2 4
I put it on the the report header and I already done creating supress formula for it where I put ---> not onfirstrecord in supress but it not working either onfirstrecord (it disappears). I also tried puttingit in GroupHeader but still it doesn't work.
both fruits as I check seems to be both same recordnumber I dont know why.

Find the recurrence relation

I'm new to recurrence relations and I'm having trouble figuring out this problem:
Find a recurrence relation for the number of ways to make a stack of green, yellow, and orange napkins so that no two green napkins are next to each other.
I've come up with a(n)=2a(n-1)+2a(n-2) but I'm not sure if that's right/ on the right track.
Any help would be great!
First of all, your answer is correct:
If the n'th napkin are green then n-1'th napkin could be yellow or orange and other n-2 napkin could be anything so it is 2*an-2.
If n'th napkin is not green it could be yellow or orange and other n-1 napkin could be anything so it is 2*an-1.
So the final answer is an = 2*an-2 + 2*an-1.

Display attributes from item in drop down menu in excel form

Could someone help me with this? I'm relatively new to excel and the VBA environment. What I need to do is create a form with a drop down menu that selects a certain key. Lets say I have the following two spreadsheets
Tab 1: "Cats"
Type Color size weight
Calico white 20 25
Tuxedo black 15 16
Dumb orange 12 22
Tab 2: "Dogs"
Type Color size weight
St Bernard cerulea 125 200
Beagle pink 25 30
Adorable blue 45 50
I'd want to have the "type" in the drop down menu and let's say St. Bernard is selected.
I want a label or cells to be populated with that type's color, size, and weight.
It's essentially a search function. Any help would be appreciated
Filters? Select the table then Click the Data Tab then click on filter (Ctrl + L).