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

Fuzzy Search Parameter Function 3

Status
Not open for further replies.

ricolame

IS-IT--Management
Nov 9, 2005
82
CN
Hi folks,

Another qn if you guys had done this before.. I would like to have a FUZZY SEARCH function on the paramter enter.

Ie. Customer Name Field
Parameter is {?CustomerName}

So i would like to have a selection formula that equates to

*{?CustomerName}* where i will also convert the input name to UPPERCASE too.


I should i have it written in my formula field ?

Any help here is greatly appreciated!

Thanks
 
{customer.FIRST NAME} like "D?n" will get Dan, Den or Don. {customer.LAST NAME} like "*s?n*" will get Johnson or Olson or Olsen.

(All of this is from the Crystal 10 Help: it is useful to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.)

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Hi Madawc & folks,

Thanks. I had read that before. May like to refine my problem statement. Btw i'm on CR10.

What i meant is doing fuzzy search BASED on my input parameter which is dynamic upon report generation.

Thus if i were to program it, how do i write in my formula such that if

1. My input dynamic paramter field is {?CustomerName}
2. Fuzzy search on data field call Customer.Name
3. Say my input is gobby, my fuzzy search will do something similar to *GOBBY* in my database and return something like

HAPPY GOBBY PTE LTD
GOBBY PTE CO
etc..


4.Next i will extend it to accepting multiple values and retrieve based on various fuzzy search conditions.
 
Let's drop the word "fuzzy", it has no meaning. You are talking about wildcards.

So do you want 1)a report with every customer that includes the word "GOBBY"? Or 2)a list of customers that includes the word "GOBBY" so you can decide what to do from there?

If you want the first, Madawc has already answered your question. If you want the 2nd, you are SOL. There is no version of crystal reports that offers this to my knowledge.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
Hi,

It should be anything similar to this ?

{CUSTOMER.NAME} like "*{?CustomerName}*"

but because of the need of ", i tried something like

"""+{?CustomerName}+""" which failed on me..


dgillz,not sure if i did interpret wrongly, but i want wildcard search of customers pertaining to the KEYWORD that user has input at the start.


Hope this clarify..
 
Please answer my question from the last post. One more time, do you want:

A) A report to print based on this keyword input?

or

B) A list of customers to appear based on this keyword input?

Any answer other than A or B is non responsive and will not help you.


Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"If you have a big enough dictionary, just about everything is a word"
--Dave Barry
 
Try
Code:
{CUSTOMER.NAME} like "*" & {?CustomerName} & "*"
You could also use
Code:
{?CustomerName} in {CUSTOMER.NAME}

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Hi Madawc,

Thanks. So it is just basically the formula that you gave that makes the trick.

I was on that line of thoughts but did not thought of the ampersand sign..which i used + instead.

Thanks!
 
Hi dgilz,

Thanks. I was thinking on both the questions you raised.

In fact, the answer is still A and B.

Yes, it is a report to print based on this keyword input?
and yes, the report is to print customer name (in fact it is a shipment report i'm doing which i wish to pull specific customers containing the keyword)

Thanks for the help rendered.
 
Help for parameter that allows "multiple" values...

The code below works OK for single wildcard entries:
{CUSTOMER.NAME} like "*" & {?CustomerName} & "*"
{?CustomerName} in {CUSTOMER.NAME}

However, I have a report where a user is allowed to enter "multiple" values for the wildcard parameter. When I use the code above a message indicating "This array must be subscripted" is displayed.

Then I tried using:
{CUSTOMER.NAME} Like "*"+ {?CustomerName} +"*")

but no records are returned...the SQL by the Crystal Report shows:
("{CUSTOMER.NAME} " LIKE '%' OR "{CUSTOMER.NAME} " LIKE '%' OR "{CUSTOMER.NAME} " LIKE '1st wildcard selection' OR "{CUSTOMER.NAME} " LIKE '2nd wildcard selection')

Is there some code I can use in the reocord selection that will use a "Like" command for this?

Thanks in advance!!

 
kwtx04rm, this is a new topic, please start a new thread.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
hi folks,

in fact this is an extension i'm trying to do.

Having my report returns multiple wildcard searches.

I have a formula similar to below:
(If {PART.ID}<>'ALL' then
UpperCase({PART.ID}) like "*" & UpperCase({?PartID}) & "*"
else
{PART.ID}<>"")

Now, my PartID input parameter accepts multiple values. But i'm having similar issue as highlighted by kwtx.

I thought this serve as a good add on to the post, since the post explains how to create a wildcard search.

So what can be done if it is extended on a multiple variable wildcard search then?

With regards,
 
I haven't tested this, but something like the following should work.
Code:
NumberVar i ;
BooleanVar Match := False ;

(If {PART.ID}<>'ALL' then
FOR i := 1 TO UBound({?PartID}) DO
(
IF UpperCase({PART.ID}) like "*" & UpperCase({?PartID}[i]) & "*" THEN  
    (
    Match := TRUE;
    Exit For ;
    )
);

Match;

else
    {PART.ID}<>"")
- Ido

view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top