Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional suppress based on total records in two groups

Status
Not open for further replies.

pjl923

Technical User
Sep 9, 2004
4
US
Using CR11

Have a pretty simple report that I'm trying to use as a cycle count worksheet. I want the user to perform 26 counts a day; so I want to show them only 26 records. I select records from the db based on a 'next count date' field I calculate from a dynamic 'last count date' field in the file. If Next Count Date is today or previous, I show the record and all it's corresponding locations in the warehouse using a group for the Item #, Description and detail of all the locations (Item could be in multiple locations, so I just group by item and show the locations)
Next I want to group the records between 'Today's Counts' (by checking to see if Next Count Date = Currentdate) or 'Overdue Counts' (Next Count Date < Currentdate).

Here's my problem:
If the 'Today's Counts' group is only 4, let's say, I want to show 22 from the 'Overdue Counts' group. If the 'Today's Counts' group is 0, I want to show 26 records from the 'Overdue Counts' group and vice versa. Otherwise, if the OVERALL TOTAL (a seperate running total) count is > 26 split it evenly down the middle; hence the '>13' logic.

I can't seem to figure out how to grab a MAXIMUM of the running total of the count in each group to use in the suppress formula to calculate how many records to show in each group. Here's the current formula I'm using in the 'Suppress' X2 option at the group & detail levels, but other than a simple >13 suppression, I don't think it's working the way I've intended:

if ({@Date Status} = "OVERDUE Counts" and {#Count #} > 13) then yes else
if ({@Date Status} = "TODAY'S Counts" and ({#Overall Total} > 26 and {#Count #} > 26)) then yes else
if ({@Date Status} = "TODAY'S Counts" and ({#Overall Total} > 26 and {#Count #} <= 13)) then no
 
Why are you using running totals as checks for the counts? Do you have row inflation? You could easily check totals based on inserted summaries and then use the running totals just for the suppression.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top