Granular Excel Pivot Table Security - excel

I currently produce a report for 5 managers that contains data for each of their employees. The raw data lives in a table in Excel file A, while Excel file B has a pivot table on it connected to the data in file A. I use the manager name as the report filter to list all of their employees data in the pivot table for that manager.
What i am trying to do is prevent the managers from being able to use the report filter to view other manager employee's data. I know I can do this easily by locking the workbook, thereby preventing the manager from using the pivot table at all... the problem arises because I would like the manager to have access to a Slicer to filter by employee name (a row label). If I lock the workbook then the Slicer is not useable, and if I enable "Use PivotTable Reports" then they can access the report filter.
Ideally what I would like is some way to force the data connection between file A and B to call for an update from file A when the report filter is changed (but not the Slicer). Because file A resides only on my PC, the update would fail in the manager's copy of file B.
Does this make any sense? I want to disable the use of the report filter, but still allow the Slicer to filter based on row label...

A functional answer turned out to be fairly easy... I hid the row that included the Report Filter, protected the sheet but allowed pivot table changes, but disallowed most everything else.
So, while the report filter IS still there, it's in a hidden row that can never be unhidden by the end user. The Slicer still allows row label filtering.

Related

Save a pivot table structure based on external source without saving/cacheing the data

I have an external data source that implements row-level security.
I have an XLSX file which I want to distribute which will have a pivot table based on the external source. All of my users have an identically configured ODBC connection, except it uses each of their personal credentials and thus they have access to different data.
I've explored all of the connection & pivot table settings that supposedly give you such controls but they are not working for me. When I save my workbook, it seems that it is not possible to prevent the contents of the pivot table (as they currently look) from being saved. When a new user opens it, they will be able to see the current pivot table contents (which they perhaps shouldn't have access to) until they click "enable content", accept the various popups and/or wait for refresh.
Previously, I created a table based on external source and configured the connection to not save data - this worked. I then created a pivot table on top of the table range and configured it to not save source data. This sort of works except the table refreshes first and so the pivot table loses its settings and you have to start again with a blank pivot.
If you create a pivot table directly on the external source (rather than indirectly via a table), which I expect is the best practice, the tickbox in pivot table options for "Save source data with file" is greyed - presumably because excel knows the source data is actually external and so the question isn't relevant - except is is relevant because the pivot table output still contains data when saved
The only thing I can think of is is save the workbook as a user with 0 permission so the pivot table is structured correctly but with 0 contents and then send that round. Users will then see no/harmless data before it auto-refreshes at which point, they'll see what they should see.
Kind of feels like a glaring omission from excel. Am I missing something?

Automatically updating data across multiple worksheets

I'm trying to create an excel workbook where updates to a master spreadsheet will be automatically reflected onto worksheets within the same workbook which derive from filtered data from the master spreadsheet.
I tried resolving this issue by creating links between rows from the master spreadsheet to the derivative worksheets. Since they are tables, however, they will constantly be filtered which I have discovered breaks the links. Since the links were row-dependent, I cannot think of a way to be able to link all of them without constant breaks. Is there a way around this issue despite the fact that there are many variables at play?
Consider using PivotTables.
Drag all relevant fields to the row area (turn off all (sub-)totals) and the field you wish to filter for as the page filter.
Select the Options dropdown on the Pivot table Analyze contextual ribbon tab and choose "Show report filter pages".

How to take data from PivotTable cache?

I have lost the connection to source analytics service. However, I still have data in PivotTable's cache (I can see from tooltips).
How to get that source data?
I am using Office365
** I cannot use show details since the pivot table has some filteres applied. And i cannot remove filters since it asks me to connect source.
(And yes I have checked this thread but it didn't work for me: Recreate Source Data from PivotTable Cache. It gives 1004 error.)
The easiest way I can think of for a table based data set is:
Show the field list on your pivot table.
Remove all filters, column labels, row labels, and values
Add one field to the values. This will show one aggregate value in the pivot table.
Double click the value and a sheet with all the data should pop up.
If it doesn't, go to the pivot table options then on the data tab check "Enable show details".
This method however will not work with OLAP data. Excel does not download the entire cube; it queries for new data slices with every change to the filters or layout of the pivot table/chart. So even if you could access the data in the pivot cache it would not hold the entire cube, but only the slices needed to show the current layout. You CAN create a snapshot cube file to hold all of the data needed to run in offline mode, however it requires you to be able to connect to the server at least once to create the file.

How do you copy the powerpivot data into the excel workbook as a table?

I have data in powerpivot that I've modified and I'd like to place it into the workbook as a regular table (and not as a pivottable). I need this so that I can run use the table for some vlookups from another worksheet in the same workbook.
I found this answer: link which I will try and summarize with out cutting and pasting to much. This assumes you have powerpivot installed.
goto powerpivot and "import from and external source" the data you want to munge and bring back into the workbook as a table
Key here is to select the checkbox “Enable selection of multiple tables”.
when prompted at the "import data" window, pick pivot report (you won't really use this)
go back to powerpivot with the "Manage Data Model:
add a new measure below your data. something like: NRofOrders:=COUNTROWS(values(FactResellerSales[SalesOrderNumber]))+0
(you won't really use this but this seems to change the query to this table so that you can use DAX)
also add any columns that you want ( for me, this is want I wanted that I wanted to be reflected back in the workbook)
back to Excel, select the data tab, click on Existing connections and select Tables: and then pick a table from your query.
boom, you're done
(the link continues on and you should read that as it's interesting but at this point you should have powerpivot query with your modification as a table in your workbook)
The July 2014 update to Power Query (pushed out at the end of Aug) simplifies the answer. With the new Power Query Update you can pull the data into the Data Model with out having to also copy it to the Works sheet.
goto powerquery and import the data you want to munge. Use the option to just add it to the Data Model.
go back to excel and then go to powerpivot with the "Manage Data Model" button.
munge your data (add columns, whatever)
back to Excel, select the data tab, click on Existing connections and select Tables: and then pick a table from your query.
boom, you're done
In the PowerPivot window you can select the table, or elements of it, and then copy (nornal right click or ctrl +c) and paste that into your spreadsheet.
This works for reasonable amounts of data but if you try and do it with thousands of rows you may find that excel objects and falls over, based on my experience.
Vlookups kind of defeat the purpose of PowerPivot :-)
Found a great solution over on Mr Excel
(http://www.mrexcel.com/forum/power-bi/637919-extracting-static-data-powerpivot-without-pivot-tables.html)
If you are trying to get a PowerPivot table into Excel, then you can simply query it. The easiest way to set that up is to first create any pivot table based on you PowerPivot data. Then double-click the measures area to drill-through. This creates a table with a connection to your PowerPivot model. Then edit the command text by going to: Data > Connections > Properties > Definition tab > Command Text.
Change it to something like
Code:
EVALUATE Table1

Excel 2010: Replace a table by an external connection without impacting other sheets

I have a big workbook with a lot of data. In one sheet I have a table. This table is used for many Pivot tables used in other sheets, which are also used in other sheets.
The data for the table was copied manually regularly. I now have a external connection to import automatically the data but I'd like to avoid impacting other sheets.
How can I use my external connection without losing my table?
Thank you for your help
This might be a helpful workaround. I have successfully done this but it may require a bit of rework and not be the exact answer you expect. (I am using Excel 2010).
The reason for a workaround is I assume this is for a regular table (not a pivot table) as the source table. Unfortunately, I don't believe the switching connection options work for regular tables in Excel 2010.
Recreate a new table just below the other in the same worksheet by going to the Data tab > Get External Data > Existing Connections
Select your data connection (assuming it has been created) then select how you want to view the data. ie: Table
Place in your existing worksheet. Use your old table as a reference to reconnect all the connections to your other sheets, then delete the old table.
At this point, I find it easier to rebuild/copy those existing links to the new table with external data.
The good news: If your source table is a pivot table or pivot chart with an existing connection, you can easily change the table to have an external data connection (and switch between data connections).
For a pivot table with an existing connection you wish to change, select a cell in the table. In the ribbon above in 'PivotTable Tools' > Options tab > Change Data Source, you will be able to select this and reconnect to another source under 'Choose connection'.
For a pivot table with static data to introduce a new connection, I would suggest a similar workaround above.
I hope this works for you.
I'm going through this too. I've done some testing, and this is the approach I am going to take.
Save copy of file (just in case!)
Create a new sheet, and create link to your database, and have it entered as a table on this new sheet
Make sure your old table (manually entered) matches the same layout as the table with the data you are connecting to (same column order and column names)
For each pivot table, change the source to the new table (it should keep all of your setup the same if the columns are labeled the same)
Do a find and replace to change all formula referencing to the new table name.
Change any code in VBA that references the old tables
This should result in the least issues while making the changes. Just don't forget the first step!
If both connections/query are SQL or PostgreSQL, you can simply copy the query code from the new query to the old query. Then you do not even have to replace anything. "Edit" - "Advanced editor"

Resources