Share via

Delete all data from pivot table connected to SQL Server, to reduce file size.

Anonymous
2013-01-11T00:35:12+00:00

I have a pivot table that connects to a SQL Server view. From time to time it would be handy if I could e-mail the empty "shell" of the pivot table to other people and they could refresh it from the database themselves. I've sorted out the SQL Server security and permissions and so on. I Just need a way of "emptying" out the pivot table so it has no data. This would achieve two things:

  1. Ensuring that when I e-mail the pivot table, it contains no sensitive data, and can only be populated by someone with appropriate SQL Server permissions
  2. Ensuring the file size is small enough to e-mail

I've thought about

  • temporarily changing the view to say WHERE 2 = 1
  • refreshing the pivot table, saving and closing the excel workbook
  • changing the view back
  • e-mailing the empty table.

but Murphy's Law says that sooner or later someone will SELECT from the view at the very instant I change it to WHERE 2 = 1 and chew my head off because it's not returning data (fair enough too). Is there a way I can delete all the data in the pivot table without resorting to the method above?

Cheers

Greg

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2013-01-11T01:08:18+00:00

It's OK! I worked it out. Go to the pivot table Options ribbon. Then click [options]. Then go to the [data] tab. Then uncheck [Save source data with file]. Then set [Number of items to retain per field] to [None]. Then save and close. Hey presto! The file was 48MB. Now it's a trifling 69KB. How good is that?

Cheers.

Was this answer helpful?

0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2016-11-02T11:24:25+00:00

    Great for you. Seems to be harder when you use PowerPivot. The [Save source data with file is grayed out. Any ideas?

    BR /Magnus

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2013-01-13T11:15:09+00:00

    Thank you for posting and providing the answer. This will help other community users when they search for this type of issue.

    Was this answer helpful?

    0 comments No comments