Skip to Content
0
K C
Apr 01, 2016 at 05:10 PM

Want to Display (Partially) Duplicate Records

46 Views

I have a query created in Crystal Reports 9 that returns over 6000 records that like this:

16022-1_9 EM 50 off 100 Winter Clear

16022-1_12 EM 50 off 100 Winter Clear

16030-7_22 SA Mattress Onsert

As you can see from this example, in some cases there may be instances where the set of digits before the first dash are duplicates:

16022-1_9 EM 50 off 100 Winter Clear

16022-1_12 EM 50 off 100 Winter Clear

16030-7_22 SA Mattress Onsert

I want to be able to create a report that filters out the 6000 records and only lists those records that start with same digits before the first dash.

In the past I have used a formula in the Selection Expert like this to find duplicates: previous({FIELD}) <> {FIELD} AND next({FIELD}) <> {FIELD} but in this case the entire field is not going to be identical, just the numbers before the dash. How do I accomplish the filtering so that I can find the records that start with the same number before the dash?

I am thinking that I need to have a formula that includes {EVENTS.eventname} startswith - but do not know how include a regular expression for all digits before a dash.

Thanks in advance for any ideas on this.