Skip to Content
0

Crystal report - Finding partial matching string in Array

Jul 13, 2017 at 04:49 PM

36

avatar image

Hi

I am working on a crystal report and have a requirement to remove the duplicate(partial/like) match entries from a multiple list parameter.
So I have a multi value parameter which might contain below value

Accounts

ABC-12345-000
XYZ-56982-111
ABC-98090-222
UXY-12334-333

What I required to send a message to a user if there are partial duplicate before first '-' like in this case, there are two ABC entries users choose, and I need to display a message to a user to pick just one entry, lfrom similar account like below:

ABC-12345-000 OR ABC-98090-222
XYZ-56982-111
UXY-12334-333

Thanks, Saif

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Ian Waterman Jul 14, 2017 at 07:49 AM
0

Create a formula

@Start

Left(yourfield, 3)

Group on this formula and suppress details and group header line and add the fields you want to display to Group footer

Add this formula to Group Header

@Reset

Whileprintingrecords;

Global stringvar accounts:=' '

Global numbervar n :=1;

Add this formula to details

@Eval

whileprintingrecords;

Global stringvar accounts;

Global numbervar n;

If n = 1 then Accounts:= Yourfield

If count(yourfield, @Start) >1 then Accounts:= Accounts &' OR ' & Yourfield;

Accounts;

In Group footer place this formula

@Display

Whileprintingrecords;

Global stringvar accounts;

Ian

Share
10 |10000 characters needed characters left characters exceeded