GDS-show data from another sheet beside column grand total - google-sheets

I have created a pivot table in data-studio from a google sheet. Another sheet in the same workbook contains a table that has a column named total. I want to show this total column beside the "column grand total" of the pivot table created from the first sheet.
Can this be done using data blending? If yes, how can I do it?
link to GDS report : https://datastudio.google.com/reporting/9e869103-e0f8-43eb-a0d2-0147ef4628cf
Desired outcome:

According to your data, Class A and Class B are join keys (since they are the data data appear in both data sources); Class C and Totals are dimensions (you can treat Totals as a metric, the result will be the same); and Record Count is a metric.
Knowing this, everything you need to do is to blend your data, as follows:
Using this new data source in a pivot table, add Class A, Class B and Totals as row dimensions of your pivot table, Class C as column dimension and Record Count as metric. The result should be:
Obviously, you can't have everything you want. In a pivot table, row dimensions appear first, then metrics and totals. It doesn't make sense to add it as the last column as you want, at least not with standard controls.

Related

Return a list if 2 criteria match in Google Sheets

In an effort to organize staff training: So far I've made the pivot table, but I'd like for the pivot table to extract who needs which training, as a list in one cell. I tried using =JOIN, but I have no idea what else.
On sheet 1:
Row 2: Staff (who need the training), They enter "NEED" in the row of the column for that training.
Column D: The Names of Training
Column E: Trainers/Staff who are providing the training
Spreadsheet Sheet 1
On Pivot Table
Columns
A: Trainer
B: What modules they're teaching
C: How long the training is
D: A cell that lists who requested the training (who entered "NEED" into Sheet 1)
I'm trying to tell it simply:
Look for the name of THIS training over in sheet 1, AND if the value of a cell in that row is "NEED", Return the Name of person/people and list it in one cell next to this pivot table......(lollll I will not cry).
The formula would be something like:
Pull the name of the people from Sheet1!F1:Z if (Training names) Sheet1!D:D match Pivot table B:B AND there's a "NEED" in the row of that training....then list those names in ONE CELL.
I'm over explaining I think, but this has taken all day and my brain simply cannot any longer and my own formulas sheet is not helping, Please help if you can.
Pivot Table
I have tried: =JOIN mixed with Match, then Filter... Idk what i'm doing. And the pivot table has no option to filter "NEEDS" from the whole data set. Instead it makes me filter the "NEEDS" of a Name/Column, but if i do that, it will filter out everyone elses data. Basically, it forces me to make a custom formula, which is great because I can learn, but... I really hope all of this made sense :(. Any help would be heavenly.
Based on my sample sheet, try this to bring back only those who NEED training:
=arrayformula({"Trainer","Module","Durantion/Mins","Who NEEDS training";query(split(flatten(if(Sheet1!D5:D<>"",Sheet1!E5:E&char(9999)&Sheet1!D5:D&char(9999)&Sheet1!C5:C&char(9999)&if(Sheet1!F5:J="NEED",Sheet1!F2:J2,),)),char(9999)),"where Col4 is not null",0)})
My solution is shown in cell L1 of Sheet1, but you can place it on a different sheet, updating the reference to Sheet1! as required.
It assumes that "Duration", "Module", "Trainer" data starts in row 5 and staff are in columns F to J. Adjust as required.
To bring back staff who NEED training and every permutation of "Duration", "Module", "Trainer" without an assigned staff, you can use:
=arrayformula({"Trainer","Module","Durantion/Mins","Who NEEDS training";unique(query(split(flatten(if(Sheet1!D5:D<>"",Sheet1!E5:E&char(9999)&Sheet1!D5:D&char(9999)&Sheet1!C5:C&char(9999)&if(Sheet1!F5:J="NEED",Sheet1!F2:J2,),)),char(9999)),"where Col1 is not null",0))})

A need to tie up cell to it's neighbor

I use spreadsheets to manage Google Ads campaigns. In first column I import campaign names using Query function:
=QUERY('data-campaigns-all'!A:H,"select B, count(A) where A > date '"&TEXT(DATEVALUE($S$1-14),"yyyy-mm-dd")&"' group by B order by B LABEL count(A) ''")
So I have a list of active campaigns for the day. I import other values (such as number of clicks, conversion values and so) based on campaign name, using sumifs or other formulas.
But I manually add a column with a budget for every single campaign. And it's just plain number. And when a new campaign pops up in the list, it adds a new row and whole dataset switch. All other metrics are tied up with campaign name, by some kind of formula (sumifs, vlookup and so) but budget (plain number) always stays at its place while other data shift.
So I want to tie up the first column (with campaign names) with budgets (which are added manually and are not in source data). The only solution that came up in my mind was to add a static sheet with campaign names and corresponding budget values and then add it to my final sheet using VLOOKUP, but I hope there's an easier solution.

Locking Columns in Google Sheets when a cell reaches a number

I am creating a spreadsheet to be used among 40 teachers to assign students to a variety of classes. Student names are in rows while the classes are in columns. As students join a class, there is a cell in the column that adds the total number of students who have joined the class. When the class reaches a specific number, I would like the column to change colors to indicate the class is full or completely lock the column so no more students may be added. Can anyone help?
Richard, if you just want to colour the column, you could try conditional formatting like so:
Pick the range of columns you want to be colour coded
Apply the custom formula =B$1>3. This means that for each column in the range, the formula will look at the first row in that column - that is why the $ is in front of the row number and not the column letter - and if that number is greater than 3 (class capacity), then the column will turn red(ish).
But if you want to lock the column, you'll need to get into Google Apps Script.

Stacking multiple query output in one sheet

For my department I made a dynamic and flexible overview sheet for every teacher, showing his of hers tutored students.
In one overview sheet I have made several query's, that gather data form different sources (students and teachers in different years). The query's are in one column, because I want to generate a list per teacher.
But the output the query formula generate, can differ in length (= number of rows it takes = number of students), that's is why I have to allow for a fixed number of rows in the overview sheet. And that can lead to ugly blank rows in my list.
Is there a way to keep the flexibility (for every teacher has a different number of tutored students), but remove the blank rows?
If any sheet for every teacher has the same number of same columns, then your data is well-structured and you could make single query on them.
=query({Sheet1!A1:C;Sheet2!A2:C},"select * where Col1 <> ''")
Pay attention on some details:
query should take only one row with headers, use Sheet1!A1:C with headers and the others SheetName!A2:C
when query have source, that contains of multiple tables, use Col1, Col2, Col3... instead of column's letters A, B, C... It may be even more convenient. This rule also works, when data is imported from another file.
You can combine ranges using , for columns and ; for rows and by wrapping the ranges in {}. (You need to add the curlies after indicating you are concatenating ranges)
Assuming in Sheet1 you aggregate the data from Sheet2 and Sheet3you can use:
={QUERY(Sheet2!A2:B, "SELECT A, B WHERE A <> ''");
QUERY(Sheet3!A2:B, "SELECT A, B WHERE A <> ''")}
Where A is the student names (or whatever cannot be empty) and B something arbitrary like marks. Of course that query can be as complex as you want (probably best to prebuild it and reuse it via reference then).

How does one import filtered data from “Sheet2” into “Sheet1?

Objective: import filtered data from “Sheet2” into “Sheet1.”
Data is filtered in “Sheet2”, an expense table with dollar amounts in column A, and categories such as “fuel”, “meals”, “parking”, etc. in column B.
I understand that one way to do it is to make a separate sheet for each category and SUM those amounts, and import them into “Sheet1”. I am able to do that, however, I would like to use one sheet and some method to do the following:
In “Sheet2” filter the data for a determined category and display a SUM for that category in a predetermined cell in “Sheet1”.
I have shared the sheets here.
If I am shown how to do this for one category I will be able to copy and paste the function into the appropriate cells in “Sheet1” for the remaining categories.
I am aware that I may not be asking this in the best way. Thanks for all your help.
~ Joe D
=sumif(Sheet2!B:B,"fuel",Sheet2!A:A)
The above formula works for fuel, simply change "fuel" to whatever you are trying to sum.
If you wanted to change what was in Sheet1, cell A1 to fuel instead of fuel total and changed all the other values in column A to match. Removing total (remembering to remove the space too)
You could then use this formula in cell B1, drag it down, and as new expenses were added. It would look at the name of the expense and sum it.
=sumif(Sheet2!B:B,A1,Sheet2!A:A)
If you didn't want to take out the total then the following formula should work if placed in B1 and dragged down.
=sumif(Sheet2!B:B,SUBSTITUTE(A1," total",""),Sheet2!A:A)

Resources