Tableau dashboard highlight filter by ID - highlight

How do I perform this selective highlighting if I have two plots that aggregates using somewhat unrelated information? I understand that sheets of a dashboard can be highlighted together when a user clicks on an item in any of the sheets.
For example, with the data below, I try to have 2 scatter plots of Quantity x Amount - 1 with Origin as the details/label, and another with the Categories. I put them in the same dashboard, and I want the user to be able to click on the Japan circle and see in which Categories we have Japanese products - i.e. highlight all the marks in the other chart where Japan is the Origin. The link to both charts is the Product IDs. This is a simplified example of what I want to do. I have a lot more records and sheets.
Product ID Origin Categories Quantity Amount
1 Japan Fruit W $10
2 China Fruit X $20
3 Japan Delicacy Y $30
4 China Delicacy Z $40
To put it another way, I want the highlighting action to also highlight the other sheets in the dashboard/workbook (whichever is feasible) based on the value of the attribute highlighted.

Related

Double (Nested) XLOOKUP with reverse search mode issue

I've created a profit/loss google sheet that allows me to price up a list of items for each project I'm working on (I've simplified it for the purpose of my issue I'm trying to solve). It works by referencing a master pricing sheet so that I can manage the current pricing from one location.
In the MasterCopy tab I'm importing the master pricing sheet for all my items. If you look at the first row, the first set of pricing for EUR, USD, AUD are my costs and the second set of those curriencies are my sell price.
https://docs.google.com/spreadsheets/d/1SE-FtDsJOblrlEpkxSwn3_L3MZ1VD6DNzTDlGTj0vCc/edit?usp=sharing
In the "Profit Loss" sheet I'm using a nested XLOOKUP formula. For columns F, G, and H the formula uses "1" for the search mode and for columns K, L, and M it is the same, but uses "-1" search mode so that it searches across the MasterCopy sheet headers in reverse.
XLOOKUP(F$2,MasterCopy!$1:$1,xlookup($A3,MasterCopy!$A:$A,MasterCopy!$1:$1000),,,1)
XLOOKUP(K$2,MasterCopy!$1:$1,xlookup($A3,MasterCopy!$A:$A,MasterCopy!$1:$1000),,,-1)
However, the issue I run into is that for some reason one of the column sets (EUR, USD, or AUD cost and sell) it will show the same pricing for the cost and sell columns for the corresponding currency. For example, cell L3 shows 1,025 USD, but the corresponding USD cost column also shows 1,025 USD, when it should actually be a value of 925 (which is correctly showing in the MasterCopy tab).
Any help would be really welcomed. I'm hoping it's a simple logic error, but just can't seem to get all the sets of pricing to show the correct values.
Edit 1
I reloaded the sheet and suddenly it's the AUD columns showing the same values. See image below
AUD columns showing same values
maybe just use the header 'AUD Sell' in Cell AR1 (MasterCopy)
AND
use this formula in Cell M3 (Profit Loss)
=XLOOKUP(M$2&" "&J$1,MasterCopy!$1:$1,xlookup($A3,MasterCopy!$A:$A,MasterCopy!$1:$1000),)
totally eliminating the search_mode which is causing this amiss.

Dropdown lists & conditional formatting in Google Sheets

I am making my business spreadsheet and my business is selling in multiple countries. So, for example, I have a drop-down list (and when Country is chosen I want it to affect the rest of the spreadsheet). In that list, I have all the countries I sell to. What I want to do is for example when I select UK it will update all the prices and costs that are there to GBP AND also hide specific columns that are not necessary for the UK. The same goes for other countries if US is selected I want to see $ currency and hide the column of VAT tax since it doesn't apply to the US.
To summarize, when Country is selected from the dropdown I want it to show different values and hide 1-2 columns. Wondering if this is even possible in sheets. Hopefully, this makes a little bit of sense. Thanks for the help!
Yes It is possible, get only the columns you want from a range.
Dropdown from a list
Go to Data > Data validation Criteria: List from range and Enter a range or formula.
The Formula
Paste this formula next to srearch key range and below the column names you want to search, Take a look at this "freshly made" Example Sheet.
=ArrayFormula(IF($B$2:$B="",,VLOOKUP($B$2:$B,$G$3:$J$16,MATCH(C$1,$G$2:$J$2,0),1)))
Choose the country and all the data will be populated, replacate this formula column and expand the lookup range to get more info put in place.
we are using MATCH to return the matching index from the column above for example Currency C1 from the range G2:J2 which is 2 in this case MATCH function returns the matching value index "column" 2, to be used as an index for vlookup function.

How to create column and lines charts from this simple spreadsheet?

I'm trying to create two charts from a local cycling club's account spreadsheet. These will provide "at-a-glance" overviews of the state of the current finances.
The spreadsheet has a columns with incoming monies (receipts) and the date received, with similar columns for outgoing money (payments).
The first chart will sum up the incoming outgoing columns and display these in a simple column chart. A quick glance should show that the incoming column is taller than the outgoing (hopefully!). This is where I hit my first problem - I don't seem to be able to use SUM in the chart:
I have ended up having to reference a cell containing the sum of the column, but this sum takes into account a cell (C3) which contains balance brought forward from a previous year which I want to ignore for this chart:
The other chart I want is a line chart showing amount of money on the y-axis and time on the x-axis. The receipts line should go up over the year (again, hopefully) and the payments should go down. I'm not even close to getting this correct:
It should be something like this, so as the year passes (x-axis) the amount (y-axis) of receipts and payments increases:
How can I create these charts?
Spreadsheet is here - https://docs.google.com/spreadsheets/d/1-8DzB6c3rZ8evfNJ8iRcO_2BletbH81FV4hIis0-Fj4/edit?usp=sharing
I tried to replicate your graph and found some issues:
On the first graph, you cannot use formula in Data Range. The input should only be a A1 notation. Creating another entry on B16:C17 and use it as graph data is correct.
If you want to ignore C3, just change the formula in your C16 with =SUM(C4:C8)
Based on the sketch you've provided for the second graph, The data will only go up by getting running total or cumulative sum of each data per category (Receipts, Payments). Unfortunately, Google Sheet does not have built it function that can automatically do that. You have to create another column for cumulative sum.
Example:
For Receipts, insert this in D4:
=ArrayFormula(If(len(C4:C8),(SUMIF(ROW(C4:C8),"<="&ROW(C4:C8),C4:C8)),))
It will create another column with cumulative sum of C4:C8.
For Payments, insert this in H3:
=ArrayFormula(If(len(G3:G7),(SUMIF(ROW(G3:G7),"<="&ROW(G3:G7),G3:G7)),))
The dates from Receipts and Payments are different, if you only use the dates of Receipt, the data for Payments will be inaccurate. You need to create another table that will combine the dates and data of those two categories.
Try this:
J2: ={A4:A8;E3:E8}
K2: =ARRAYFORMULA(IFERROR(VLOOKUP(J2:J11, A4:D8, 4, false)))
L2: =ARRAYFORMULA(IFERROR(VLOOKUP(J2:J11, E3:H7, 4, false)))
Make sure to add Labels on K1 and L1.
It should look like this:
Once you have the data, just highlight J1:L11 and Go to Insert -> Chart -> Convert it to Smooth line chart -> Check Aggregate
The graph should look like this:
References:
VLOOKUP
ARRAYFORMULA

Trying to get the size (in %) of subcategories in a pivot

I am keeping track of my (stock) portfolio in Google Sheets, as follows:
category subcategory company amount
-------------------------------------------
health care diagnostics AA 100
health care diagnostics AB 50
materials mining BA 75
financials banks CA 30
financials insurers CB 35
financials banks CC 10
financials banks CD 40
financials hedge fund CE 5
health care equipment DA 50
But now I want to extract some statistics from this, and I'm using a Pivot. Specifically, I want to see:
the relative size of each category in the portfolio
the relative size of each subcategory in the portfolio
the relative size of each company in their subcategory
The first two I get done:
For instance, I can see that:
category financials has a relative size of 30% in the portfolio
subcategory diagnostics has a relative size of 37.97% in the portfolio
What is missing however, is the third column, see mockup below:
I can now see in the last column what the relative size of each company is in its subcategory:
Company CD is 50% of the subcategory banks
Company AB is 300.33% of the subcategory diagnostics
That last column however, is not calculated but added manually to show what output I am trying to get but am unable to.
Does anyone know how to have this last column as part of the Pivot?
Here is a link to the Google Sheet used: Pivot
Currently, there is no % by subtotal option in Google Sheets to show percentages against subtotals for the whole Pivot Table:
As a workaround, you can display the subtotal percentages by filtering the Pivot Table to display only one subcategory, for example:
Add Filter here and select subcategory:
Then select the desired field, for example, banks, and click OK.:
This should display the subtotal percentages like this:
Note: You can delete category field in Rows to make the Pivot Table cleaner.
You can also submit a feature idea request to Google Workspace, please see instructions on this site: Submit ideas for Google Workspace and Cloud Identity
So I found out there are two possible solution using calculated column and another using arrayformula.
Option 1: Use a duplicate pivot table. One issue of getPivotData function is that it will run in the table calculations stage so it will return empty result. So the solution was to have two clones of the pivot table. One will be used to retrieve the data and the other to retrieve the subtotal.
The formula to use would be
=amount/getpivotdata("amount",'Copy of Pivot'!$F$10, "category", category, "subcategory", subcategory)
Where amount, category, subcategory without the double quotes are values (references) filled by Google Sheets. While the double quoted ones are column names.
You also need to set summarize by to custom for it to work.
The only issue I found here is that I couldn't find a way to identify subtotal or total rows, they do have company value equal to the first record in the group. If anyone know how to know if I am rendering a subtotal, please let me know.
The second option is to use one pivot table only but reference original data.
=amount/SUM(QUERY($A$1:$D,"Select D Where A='"&category&"' AND B='"&subcategory&"'",false))
It still shares the same total rows though.
The last option will be the least robust. It would be using arrayformula but I don't have that ready at the moment. It is main issue is that changing the column orders or adding new columns will require to keep the position of the refenced columns and move the arrayformula columns. Not to mention, handling the empty cells in a category since data is grouped.

Finding Conditional sum to determine the Units Sold Units Remaining in inventory sheet

I have a Google sheet Here is the spreadsheet which is used for determining the inventory at FIFO basis. I have different products that come into my stock and I sell them.
I bring in fruits and record entries in A to E columns using simple formulas. But the problem is here after the E columns from F to I. When the sale take place I increase the existing value in G1 and select E1, The formulas would dynamically display the selling price based on purchase price.
Say if I have sold 50 more apples then G1 becomes 550.
I am ok if the products are continuous like Green color (Apples), When the products are of different types they need to coined using SUMIFs or something else which I am not sure how to implement.
Please help to display based on yellow cells for entire table
Here is the
=MIN(C4,$G$1-SUM($F$3:F3))
Please see if this helps:
=IF(A4=$E$1,MIN(C4,$G$1-SUMIF($A$3:A3,$E$1,$F$3:F3)),0)
The formula is for F4 and needed to be copyed down.
It uses sumif for a product name + checks if current product is "apple" or one you've selected.

Resources