D
Doug_Scott
Version: 2008
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel
Because of a suspicious corruption bug in a spreadsheet with a pivot table, I decided to try to separate my data from my analysis and presentation of it in pivot tables. That is, I'm trying to keep just data in one (or several) spreadsheets, and in another build the pivot tables that refer to the just-data spreadsheets. But I'm having some difficulty and am beginning to wonder if exactly what I want to do is possible.
Here's a simple description:
- Create a new spreadsheet
- On four rows, add the following:
Column1 Column2 Column3
1 2 3
4 5 6
7 8 9
- Save the spreadsheet as "test.xlsx"
- Create a new spreadsheet
- In the new spreadsheet, go to Insert/Name/Define ...
- Type "named_range" in the name edit box
- Type "='[test.xlsx]Sheet1'!$A$1:$C$4" in the Refers to edit box
- Hit OK
- (optional step - add a "=sum(named_range)" formula somewhere in the second spreadsheet to verify that you've created your named range properly and the data can be discovered - you should get a result of 45)
- Now attempt to create a pivot table with the wizard:
- Data/Pivot Table Report ..., select Microsoft Excel list or database, hit the next button ...
- Type "named_range" in the edit box and hit Next
The result is an error "Reference is not valid". I would expect that the wizard is able to continue. Especially in the light of the following: when you get rid of the error dialog, the first spreadsheet is brought into view with the named_range selected!
Furthermore, if you physically over-select the exact same area that excel presents to you as selected, the range in the wizard is replaced with the literal range that you had previously defined for named_range. At that point if you hit Next, the wizard continues. (And I've also verified that you create a valid pivot table).
So external-ness is not the problem. It's named ranges that point to an external reference that are problematic. Named ranges DO work if the range points to a reference within the same spreadsheet. I imagine your user-base would have rioted long before now if that was not the case
So the next question you may ask is why don't I just go with the literal selection? Well the named range is especially powerful in this scenario when it works because I could hopefully make it dynamic with that OFFSET trick you'll find documented across the web. Then the range grows with the addition of data, which in my case is a guarantee.
Again I point out that this architectural technique is really to protect me in the case of corruption. I'm pretty certain a flat spreadsheet is going to stay pretty clean. If I separate my pivot tables into a separate spreadsheet, I gain a measure of security over data loss, which given that I've lost some already, is huge. I can rebuild pivot tables easily, but lost data not so much (yes, my backup was working, but I discovered the spreadsheet had been corrupted five days ago, so I lost a week of data).
Sorry for the novel, but I think I've defined the boundaries crisply enough that one could experiment and ultimately recognize if there was indeed a problem, of if my technique was improper.
Thanks,
Doug
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel
Because of a suspicious corruption bug in a spreadsheet with a pivot table, I decided to try to separate my data from my analysis and presentation of it in pivot tables. That is, I'm trying to keep just data in one (or several) spreadsheets, and in another build the pivot tables that refer to the just-data spreadsheets. But I'm having some difficulty and am beginning to wonder if exactly what I want to do is possible.
Here's a simple description:
- Create a new spreadsheet
- On four rows, add the following:
Column1 Column2 Column3
1 2 3
4 5 6
7 8 9
- Save the spreadsheet as "test.xlsx"
- Create a new spreadsheet
- In the new spreadsheet, go to Insert/Name/Define ...
- Type "named_range" in the name edit box
- Type "='[test.xlsx]Sheet1'!$A$1:$C$4" in the Refers to edit box
- Hit OK
- (optional step - add a "=sum(named_range)" formula somewhere in the second spreadsheet to verify that you've created your named range properly and the data can be discovered - you should get a result of 45)
- Now attempt to create a pivot table with the wizard:
- Data/Pivot Table Report ..., select Microsoft Excel list or database, hit the next button ...
- Type "named_range" in the edit box and hit Next
The result is an error "Reference is not valid". I would expect that the wizard is able to continue. Especially in the light of the following: when you get rid of the error dialog, the first spreadsheet is brought into view with the named_range selected!
Furthermore, if you physically over-select the exact same area that excel presents to you as selected, the range in the wizard is replaced with the literal range that you had previously defined for named_range. At that point if you hit Next, the wizard continues. (And I've also verified that you create a valid pivot table).
So external-ness is not the problem. It's named ranges that point to an external reference that are problematic. Named ranges DO work if the range points to a reference within the same spreadsheet. I imagine your user-base would have rioted long before now if that was not the case
So the next question you may ask is why don't I just go with the literal selection? Well the named range is especially powerful in this scenario when it works because I could hopefully make it dynamic with that OFFSET trick you'll find documented across the web. Then the range grows with the addition of data, which in my case is a guarantee.
Again I point out that this architectural technique is really to protect me in the case of corruption. I'm pretty certain a flat spreadsheet is going to stay pretty clean. If I separate my pivot tables into a separate spreadsheet, I gain a measure of security over data loss, which given that I've lost some already, is huge. I can rebuild pivot tables easily, but lost data not so much (yes, my backup was working, but I discovered the spreadsheet had been corrupted five days ago, so I lost a week of data).
Sorry for the novel, but I think I've defined the boundaries crisply enough that one could experiment and ultimately recognize if there was indeed a problem, of if my technique was improper.
Thanks,
Doug