Filter report on subtotal?

Harleightzmom

New Member
Joined
Oct 20, 2015
Messages
11
Is there a way to filter a report based on the subtotal? It will let filter on individual values, but not the subtotals. I have some customers that place multiple orders in a day, and I am trying to find the ones that have multiple order numbers on any given day.

Am I just approaching this all wrong?
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
The fields show a customer, an order number, and the date ordered. I have a basic report set up by date and customer, with a subtotal for counting the orders for each customer that day.
 
Upvote 0
Based upon the fields you have indicated, the following SQL statement should provide what you want.

Code:
SELECT Table1.CustName, Table1.ODate, Count(Table1.Onum) AS CountOfOnum
FROM Table1
GROUP BY Table1.CustName, Table1.ODate;

Use the query as the record source for your report.
 
Upvote 0
alansidman; he wants records with more than one order for a customer for a date so he needs criteria for that. My air code may not be right, but I'm thinking
Code:
SELECT Table1.CustName, Table1.ODate, Count(Table1.Onum) AS CountOfOnum FROM Table1 WHERE 
Table1.CountOfOnum > 1 AND Table1.ODate = #01/01/2015# GROUP BY Table1.CustName, Table1.ODate;
.
I suspect a control reference or parameter would be needed in place of a hard coded data.
 
Upvote 0
Micron: If he has more than one order per record (is that what you are saying), then don't we have a normalization issue that should be addressed? To be honest, I'm not sure at this point what the OP wants. Let's hope he clarifies for us.
 
Upvote 0
Maybe, but not necessarily. It's not uncommon to have related fields in other tables as you no doubt know, but sometimes there are pairs (or even more). In a situation like I allude to, I can't recall if I thought the db was normalized to the nth degree, but I do know that the designers of the multi-million dollar system were IS professionals and I was not. These people seemed content to create many composite primary fields in this huge db, where others say no, create only composite indexes. Anyway, multiple inner joins between a pair of many to many tables did cause some duplication. I can't recall if the solution was to query that query or modify the joins.

Besides all that, if I understand correctly, he has some customers with multiple orders in a day. This must be a common situation in business, so that would make multiple order records for a customer a distinct possibility, correct?
 
Last edited:
Upvote 0

Forum statistics

Threads
1,221,834
Messages
6,162,268
Members
451,758
Latest member
lmcquade91

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