I am using power query to get my tables from an external workbook. When I create a slicer for one of my pivot tables the other pivot tables don't show up in the pivottable connection. I want to have one slicer for multiple pivot tables and I am not sure why the pivot tables isn't showing up. Any help would be awesome!
A slicer can only connect to a pivot table that uses the same pivot cache. Chances are that if you don't see the other pivot tables in the slicer connection, they are using a different pivot cache.
If you use Power Query to get the data, make sure that you add the query to the workbook data model. Pivot tables that are created from the data model will share the same pivot cache.
Given you don't have PowerPivot installed (or don't have the DataModel that is built in to Excel 2013 or later) then you've got two options:
Join both data sources in PowerQuery on a common field, so that you
bring in just one Table. Then everything will be on the same
PivotCache (allowing Slicers) if not PivotTable.
Use one VBA routine to limit slicer selection to one item only, and another routine to sync slicers across different PivotCaches.
If you elect for the latter, then Jerry Sullivan's code from this link will limit users to selecting just one item in a Slicer, and my code from https://stackoverflow.com/a/39604425/2507160 will then show you how to sync this Slicer to other Slicers on different PivotCaches, in order to keep all Pivots showing the same thing.
Related
I have a spreadsheet that has a lot of sheets of data grouped by category. I have a main sheet that I want a user to be able to choose which categories of data to use, and it will pull that data into one long list.
Here is an example spreadsheet of what I want to do: LINK TO SHEET
I could combine all the data into one spreadsheet, but if I were to do that with the dataset I am working with, I would have tens of thousands of rows. So, having the data stored on separate sheets is preferred. I am open to having separate spreadsheets altogether if that will make it easier. Currently, I have tried Using INDIRECT and QUERY, but can only get the first sheet of data to show.
I would prefer to stick to normal functions, but could jump into appscript if I need to create a custom formula
I have tried using INDIRECT and CONCAT, and can get the first set of data, but not subsequent data. Also tried wrapping it in a query like this:
=QUERY({ARRAYFORMULA(INDIRECT(CONCAT(A2:A,"!a2:z100"))},"select * where Col1 is not null",1))
Splitting it up into separate spreadsheets, I was able to use the function:
=QUERY({ARRAYFORMULA(IMPORTRANGE(B2:B,"A1:Z10"))},"select * where Col1 is not null",1)
But it also would only pull the first set of data, not the subsequent rows.
All of this was me first attempting to get the information, not getting the information filtered by the sheets that were checked as well. I am pretty familiar with appscript as well and open to appscript solutions, but would prefer to stay away from it if possible.
You do not need additional column. Use REDUCE() with few other formula-
=REDUCE(HSTACK("Dataset Name","Data 1","Data 2","Data 3","Data 4"),FILTER(A2:A,B2:B=TRUE),
LAMBDA(x,y,VSTACK(x,QUERY(INDIRECT(y&"!A2:E"),"where A is not null"))))
I made a Google Form for employees to use to clock in and out each day. The data is going to a Google Sheet, which is turned into a pivot table and all is well except for how to view which employees did not clock in on a specific day. Ideally, I want a list of absent employees per day/employees who did not clock in/out on a certain day.
The Google Form has employees select their name from a drop down menu and select clock in or clock out. The data goes to a Google Sheet, which I have made a data processed tab from, to make a pivot table from. The list of absent employees does not need to be within pivot table, it can be a seperate tab. If it is possible to have absent employees listed somehow in the pivot table, that's great. Not a big deal if not.
Right now, I am manually going in and selecting employees who clocked in/out on a particular date, adding that to its own column, and comparing that column with the master employee list. Is there an automated way to do this? I am familiar with comparing two columns, but can't figure out how to sort employees based on the date they clocked in/out into one column to then compare it to another one (unless I manually create column at end of work day). Thank you!!
https://drive.google.com/file/d/1v5ssyIaW0fUdIBTKTr6FNZIzV1WNilqN/view?usp=sharing This is the raw data from Google From
https://drive.google.com/file/d/1axWe_nPSTvIPM2RvIz7AQZE_NSJmIEdQ/view?usp=sharing This is processed data which fills pivot table
https://drive.google.com/file/d/13rBxzJ5RtnYc-vo3RzocMrSwtMy9kbaB/view?usp=sharing This is pivot table
I have a big sheet with quite a lot of info that keeps growing over time. Based on that, I have created several pivot tables that do some calculations and rankings.
Every ranking keeps growing, so pivot tables may contain 10 rows now, but can grow up to 20 or 30 rows.
I managed to insert several pivot tables in the same sheet and now it looks well, with every ranking after the next one. However, if I add multiple rows, the pivot tables grow and start overlapping, so after a while the ones below start disappearing in favour of the first ones.
Is there a way to have multiple pivot tables in the same sheet with a fixed number of rows among them, preventing them from overlapping?
If you want to 'play' with the data, I created a sample in https://docs.google.com/spreadsheets/d/1MVX3tp6GIqVX6hTyk6TsCxV7YngiMpi7E8oSxa7a9ck/edit?usp=sharing. It is just a ranking on races, where I want to track the best times on different legs. Then it has a second sheet 'rankings' in which I have different pivot tables, one for each leg.
HOw's this for a single formula solution that will scale infinitely in users or legs:
=ARRAYFORMULA(QUERY(SPLIT(FLATTEN(results!A2:A&"|Best of "&results!D1:1&"|"&OFFSET(results!D2,,,ROWS(results!D2:D),COLUMNS(results!D1:1))),"|",0,0),"Select Col2,Col1,MIN(Col3) where Col1<>'' and Col2<>'Best of ' group by Col1,Col2 order by Col2, MIN(Col3) label MIN(Col3)'Best', Col1'User',Col2''"))
You'll find it in cell B1 on the new tab in your sample called MK.Idea
I should mention that FLATTEN() is an undocumented function that I only recently discovered. I've believe it is intended to remain "hidden" in the back end of the sheets programming, but if what I did is what you're after, there really isn't a more efficient way to do it. I've spoken with an engineer at Google who was surprised it existed as well and told me there were no plans to deprecate it, so here's hoping! For a demo of what it does generally, you can see my sample here:
https://docs.google.com/spreadsheets/d/196NDPUZ-p2sPiiiYlYsJeHD6F_eJq7CWO_hP7rFqGpc/edit?usp=sharing
Spreadsheets and Pivot Tables are marvelous tools for data analysis but they aren't too friendly for creating reports and dashboards, if you are open, to recommendations try Google Data Studio (it includes pivot tables too --> https://support.google.com/datastudio/answer/7516660?hl=en)
Let say that you don't have time to learn another app or you just prefer to keep using spreadsheets, in this case it will be required to implement a workaround.
First, bear in mind that Pivot Tables don't actually overlap, instead an error message is shown:
Solution: insert some rows/columns to give enough room to the Pivot Table to be expanded.
NOTE: You could do this in advance by including a "safe zone" (meaning blank rows /columns) around the pivot tables. You could hide/unhide this "safe zone" as needed.
If you don't want to do the above manually, I think that it should be possible to use an on edit trigger of Google Apps Script to detect that pivot tables are shown and insert new rows/columns to avoid this. If the Pivot Table top left cell returns #REF! your script could use a do.. while or a while to insert the required rows or columns. An smart algorithm will read the Pivot Table settings to calculate the required rows and columns and then insert the required rows / columns in one pass.
Related
Pivot table with Google Script
I created a pivot table in Google Sheets that pulls student enrollment and attendance information from a report that we download from the state reporting system. I run this report multiple times a year to look at a variety of information. The columns always stay the same, but the rows/cell values change each time I run the report. When I paste the data over the data that I used last time, the pivot table goes blank. There is no easy way to identify what data has changed and the report contains thousands of rows of data. I tried re-selecting the pivot table data range, but the pivot table is still showing as blank. Is there a way to update the data without having to rebuild the pivot table in Google Sheets? I can't share the sheet I am working with since it contains confidential information.
I need to create a table that will calculate the percent of one column from another column. The problem is that those column are calculated by pivot table so i cant use the calculated filed on them( it gives me only the fields that are on the table connected to the pivot table).
I have tried to do this calculation by taking the pivot table to the power query but when i update the database it does not update the calculation in the power query
what is the most simple way to do this calculation?
thanks!
liron
If Power Query is reading cells from your pivot table in an Excel workbook, then you'd need to first refresh the pivot table and then Power Query.
Alternatively, Power Query can directly read from most databases. Why not just do the pivot directly against the database table from Power Query, and then the percent calculation will always see the latest data.