Access Pivot Table to show % of all records when only top 10 items are shown

General Ledger

Active Member
Joined
Dec 31, 2007
Messages
460
Dear All,

I am using Access 2007 and am at best an intermediate user so please be detailed in your response.

I have a pivot table where I show the top 10 customers based on the sume of open sales orders. The fields are Customer Name and Sales. I added another instance of Sales and have the value shown as a % of the total. This works as expected.

My problem is I want the % of Sales to be based on the total of all open sales for all customers, not just the 10 customers being shown in the pivot table.

Can anyone provide guidance on how to get the % to calculated on total sales orders rather than for just the shown records?

Best regards,

General Ledger
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
After you have created your first query, create a second one with the same table as the record source. Create an aggregate to sum the values.

Here is the SQL statement for the first, substitute your field names as appropriate.

SELECT TOP 5 Table1.ID, Table1.pName, Sum(Table1.pValue) AS SumOfpValue
FROM Table1
GROUP BY Table1.ID, Table1.pName;

Here is the SQL for the second query:

SELECT "" AS ID, "total" AS pName, Sum(Table1.pValue) AS SumOfpValue
FROM Table1
GROUP BY "", "total";

Now do a Union query to join the two queries into one. You now have the details for the top 5 (in this case) and the total for the table in the second query. You can now use this to create your Pivot table.

Alan
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,999
Members
452,373
Latest member
TimReeks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top