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

Supressing Data to first occurance

Status
Not open for further replies.

cvasquez

MIS
Feb 28, 2001
88
0
0
US
Hello everyone. These are the fields that I am using on the report.

CustomerID, Company Name, Order Date, YTD Purchase

I am getting multiple occurances on CustomerID because I am using a date Range using Order Date field. The data is not duplicated in reality because within that Date Range, there has been more than one transaction.

I just simply want the first occurance for that Customer ID within that range date. I don't want to display the rest of the transaction within that year just the first occurance. Please help, I am using Crystal Reports 10.
 
First insert a group on customer ID. If by first occurrence you mean the minimum date within the date range, then go to report->selection formula->GROUP and enter:

{table.date} = minimum({table.date},{table.customerID})

This will display only the earliest date in the range per customer. If you need to do calculations, you will need to use running totals, since inserted summaries would include non-group selected values.

-LB
 
Okay great. There is a good start.
Before I was doing:
{SYSOENT.ORDER_DATE} = MINIMUM({SYSOENT.ORDER_DATE})
And by doing this, I was missing hundreds of records.

Now that I implemented what you had told me.
{SYSOENT.ORDER_DATE} = MINIMUM({SYSOENT.ORDER_DATE},{SYSCUST.CUSTOMER_ID})

I get an error that says: "There must be a group that matches this field". I don't know what to do from here.

I forgot to tell you that I am doing an inner join.
 
You need to insert a group on {SYSCUST.CUSTOMER_ID}. If you don't want to display the group sections, suppress them. Be sure you use the formula in the GROUP selection area.

-LB
 
Will re-estate what I had said before because it is very important. Line above says:

"Before I was doing:
{SYSOENT.ORDER_DATE} = MINIMUM({SYSOENT.ORDER_DATE})
And by doing this, I was missing hundreds of records."

This command actually grabs the first minimum date NOT and I repeat NOT found in every Customer ID but instead on the date itself. So since it refers to the date, then if that date is not found within that customer id then the record will not show.

The MINIMUM command line does not work properly.
 
Hi,

You are right.

{SYSOENT.ORDER_DATE} = MINIMUM({SYSOENT.ORDER_DATE}) won't give you anything related with Customer ID.

In the Report Designer, find Help (click F1) and learn what's the options for minimum function, after that, you may understand LB's comments.

Ted
 
If you follow my suggestion, the report will select the minimum date within the specified range for each particular customer. The record selection formula limits all records coming into the report to those within the specified range. The group selection will select the minimum date within that range per customer group.

-LB
 
Great. I did. It works. AWZOME. Thank you everyone!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top