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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have this report Group Customer

Status
Not open for further replies.

timISST

MIS
Jun 12, 2012
35
US
I have this report
Group Customer with subgroup order number and what i am trying to do is filter this so it will only show a customer that has an item occuring more than 1 time in a given order ( checking for order entry errors.

IE

Customer 5
Order 1
Item a
Item B
Item A
Item C
I want the out come to show Customer 5 order 1 Item A otherwise if nothing is duplicated in the order i dont want to see that record. Any ideas?
 
You don't mention which version of Crystal you're using. There may be an easier way to do this but, if your version allows it, you could do the following:

1. Create a third group on the field that identifies an item. For this example I'll call it {MyTable.Item_ID}.

2. Create a running total that counts {MyTable.Item_ID} and resets on change of {MyTable.Item_ID}. I'll call this {#ItemCount}.

3. Create a formula that looks something like the following (I'll call this {@GroupHasDuplicates}:

WhileReadingRecords;
NumberVar GroupDuplicates;

If PreviousIsNull({MyTable.Group_ID}) or {MyTable.Group_ID} <> Previous({MyTable.Group_ID}) then
GroupDuplicates := 0;
If {#ItemCount} > 0 then GroupDuplicates = 1;
GroupDuplicates

4. Create a similar formula to count for order duplicates.

5. Create a Group selection formula on the Group group that is something like the following:

{@GroupHasDuplicates} > 0

6. Create a similar group selection formula for the Order group.

-Dell

DecisionFirst Technologies - Six-time SAP BusinessObjects Solution Partner of the Year
 
Another method:

Go to report->selection formula->GROUP and enter:

count({table.item},{table.customer})<> distinctcount({table.item},{table.customer})

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top