Hot Topic (More than 10 Replies) Searchs on a Keyword field and a thank you. (Read 1068 times)
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
Searchs on a Keyword field and a thank you.
Sep 19th, 2007 at 10:41pm
Print Post Print Post  
Hi all, Thanks for the help and the best wishes, you gave me in regard of my new  baby coming to be.

On another note i would like to thank each and everyone of you for the help you have been giving and continue to give me on what seems like a daily basis.

There has been time's I wanted to throw the computer out the window.  Each day I learn and understand how it works more and more.


So once again I thank you Smiley

Now here is the question.


I have a keyword field in my sub form that has data in, using the following code
"CKeyField = By QS0 + ";" + Job Name + ";" + Merchant + ";" + Status  + ";" + Street Name  + ";" +  District  + ";" + City0  + ";" + Builder  + ";" + Merchant REF" + ";" DateReceived

as you can see it takes data from the other LE on the form, and fills it up.

I have created some button that allow some searching of the record ie "By QS0" has static data in of peoples name so that wont change but I want to be able to do a search on date ranges as I have n LE called date received.

Any help would be great.

Regards
  
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Searchs on a Keyword field and a thank you.
Reply #1 - Sep 20th, 2007 at 1:37am
Print Post Print Post  
1.  I don't see a missing "+" before DateReceived.
"CKeyField = By QS0 + ";" + Job Name + ";" + Merchant + ";" + Status  + ";" + Street Name  + ";" +  District  + ";" + City0  + ";" + Builder  + ";" + Merchant REF" + ";" + DateReceived
2.  Why not search in the DateReceived element?
3.  How about a Universal Search vs. a complex Keyword field?
4.  What is triggering the filling of the Keyfield.  If this is from a line item on a subform, it looks like it will always be overwritten, so only the last line content will be there.  Should this be "CKeyField += ... to allow all lines to be there?

For a moment, forget what has been done, but explain please, what you are trying to do?
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
Re: Searchs on a Keyword field and a thank you.
Reply #2 - Sep 20th, 2007 at 9:03pm
Print Post Print Post  
Hey Bob,

It is really continuing from our chat via Skype,

I will answer your questions first
1) There is now a + in front of date received.
2) Because I have many LE's on the subform that i need to search on.
3) I need to be able to search from the parent form, different LE on the subform, including part searches and single dates and date ranges, so from what I understand i believe that I have to do a keyword search

I have in the Keyword LE this code "CKeyField = By QS0 + ";" + Job Name + ";" .........etc (this rest of this line contains the other LE's)"

I need to be able from the parent form, to search on single dates, date ranges, part word searches, bear in mind that I have 4 LEs on the subform that are dates.

Regards

drastixnz

  
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Searchs on a Keyword field and a thank you.
Reply #3 - Sep 21st, 2007 at 12:14am
Print Post Print Post  
I have been totally confused about the structure here, and usisng Skype, I finally got a chance to look at this construction. 

Among other things, each record has a KeyWord element that is populated with values from many elements.  There are no mulitple sub records linked to a parent record, so the values in the KeyWord element are not overwritten.  The subrecords are added at the subform level, not from the parent.

The "Parent Form" is more like a menu form.  There is only one record.  There is a RetrieveSpecElement on that form that is filled with a Retrieve Spec value that looks into the other database KeyWord element for a match, and shows the matching retrieved records in a sub form, table view.  This element is a Parent Link element.  The Child Link element is the KeyWord element.

The current search problem is that there are multiple dates in the KeyWord element: elements like DateCompleted;DateReceived;DateShipped, etc.  If a date for DateReceived is entered into the RetrieveSpecElement, the records that come back could be any one of those DateElements, there is no way to say DateReceived, it is only matching any string that matches that date.  And there is no way to put in a normal date range like 3/15/07..8/20/07.  But at least I now have a better understanding of the problem.

I don't have access to Sesame now and haven't tried this yet, but this is my current thinking   ....  put a formula into the RetrieveSpecElement.   I know that DateReceived is the seventh element in the KeyWord element.  The KeyWord element is just an array, So put in a formula that says, Take the value of the seventh element in the array and deal with that.  So the formula would = seventh array value, or the formula could compare the seventh element to see if >@date-30 for the last 30 days.  Could do a similar approach if looking for DateStarted.  Determine the array element that holds DateStarted, and extract that value for the formula.  The array to look at is the KeyWord element.

I hope there is enough info here to try that out.  And I think that the ArrayElementPosition is possible with version 1.  I may be using wrong terminology for ArrayElementPosition, manuals not available.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
drastixnz
Full Member
***
Offline


A Newbie....

Posts: 146
Location: New Zealand
Joined: Nov 29th, 2006
Re: Searchs on a Keyword field and a thank you.
Reply #4 - Sep 21st, 2007 at 2:50am
Print Post Print Post  
Thank you bob for the help.
  
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Searchs on a Keyword field and a thank you.
Reply #5 - Sep 21st, 2007 at 3:00am
Print Post Print Post  
You're welcome.

Everyone here helps one another. 
I have received my share of help, also.

Still need a working solution ....... I think extracting the value out of the KeyWord array will work.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Searchs on a Keyword field and a thank you.
Reply #6 - Sep 21st, 2007 at 3:03pm
Print Post Print Post  
If the keyword field is being used as the parent key for the subform link then it does not matter what position the Date appears in as the parent key is being used as a retrieve spec. So it would act the same way that a keyword search would normally work except in this case it is being used to form a subrecord link rather then as criteria to retrieve records from search.

Is the data from the subrecords only need to be available on a Read-Only basis or are users going to be actively changing the data that is in the subrecords from the parent form?

If it is only needed on a ReadOnly basis then I personally would be using a Report or X-Commands to display the data.

If it is needed to be changed then the first step would be to make the Key field on the Parent form and the one on the Subform a Text field. You are not going to want to use keyword fields as that will mean a Keyword search will be used to create the linking. The Key element in the subform will remain a seperated string but it will be stored in a text field.

-Ray
« Last Edit: Sep 21st, 2007 at 9:12pm by Ray the Reaper »  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Searchs on a Keyword field and a thank you.
Reply #7 - Sep 21st, 2007 at 9:03pm
Print Post Print Post  
Sorry if I was not clear.

I mentioned my own confusion until I saw the application first hand.

Parent form has a text element, I called it RetrieveSpecElement.  This is the ParentLink element in natural relationship.
Subform has a KeyWord element that has an array of element values from the subform.  This is ChildLink element in natural relationship

Date from sub form is returned to Parent form, for Read Only, but much better than report.

From the parent form, a string is entered into RetrieveSpecElement.  It pulls up a table view list of records in the subform that have a matching value iin the KeyWord element.  From that tableview, a record is selected, a "Copy Record" button on Parent is clicked and data from that sub record is copied to elements on the Parent Record to be viewed with other form features.  Report is not practical here.

The problem is retrieveing the correct data element from the KeyWord array.  If 9/4/07 is entered as a value, then records may come up that had ShippedDate = 9/4, StartDate= 9/4, and CompletedDate= 9/4 because they all have 9/4/07 somewhere in the KeyWord element.  If the 9/4 is supposed to be the CompletedDate record, then CompletedDate position must be known as the value to extract, ie: the seventh value in the KeyWord.

I have not seen a retrieval like this before,  It is very creative.  It may have some other issues, but I think it has a lot of potential use.  I would not have designed this in the same manner, but we all have our own approach to solutions.  So, trying to work with his existing design, this is an attempt to make it work.

  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Searchs on a Keyword field and a thank you.
Reply #8 - Sep 21st, 2007 at 9:36pm
Print Post Print Post  
The subform link has to be relational to work the way you are describing Bob. I'm pretty certain that it is.

The elements will need to be standard text fields, Not Keyword fields. The values stored in them will need to be separated by a character other than a Semi-colon. The Semi-colon is special to search criteria which is what the parent key value is. It's search criteria or a Restriction if you want to look at it in a different way. Parsing the parent key so that the seventh value needs to be in the seventh position when working with keyword fields, semi-colon separated lists, and Q&A Style Search Syntax is a royal pain. It's much easier to use another separator.

Say for example you had a Parent key value of Jim;Bob. That would get both the subrecords that have just Jim in them and the subrecords that have just Bob in them, and ones that have Bob;Joe in them, etc. If you wanted ones that had exactly Jim;Bob, you're best bet is to change the separator to something other than a semi-colon such as a pipe(|). This way a retrieve of just Jim|Bob gets you what you want.

I have seen subrecord links built like this but with using string values and not dates. The same concept still applies though, the values need to be separated by a separator that means nothing in Search syntax and cannot appear in the data. Some of them get rather complex in length, but they go by the idea that the Parent Key field is a restriction on what subrecords can appear.

If all you are filtering by is Date, and the Date element is the 7th out of 10 criteria in the subrecords link field, then the parent key would be ..|..|..|..|..|..|2007/09/..|..|..|.. to get you all of the records in September. It would not care what was in the other 9 spots in the child key but it knows that the 7th spot has to start with 2007/09/

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Searchs on a Keyword field and a thank you.
Reply #9 - Sep 21st, 2007 at 11:44pm
Print Post Print Post  
1.  You are right, the link is Relational

2.  I know that the normal method of linking would be using text elements, not KeyWord elements.  And this may not work.  As noted above, this is not my design, but sometimes some surprising results when you experiment.  In this case, if the Keyword element on the subrecord works, and it seems to so far, it may open some doors that were not anticipated.

3.  I wonder if you and I may be using terminology differently also.  When I am talking about a ChildLink, I mean the element on the subrecord that may contain a match that is defined by the value in the element on the Parent record, which I referred to as the RetrieveSpecelement.  In any case, at first look, you say "What is going on here?"  But after you dig in and do an autopsy, you see a very creative approach.  Whether this is an accident, or be design, I did not pursue.

4.  The dates in the KeyWord element, on the Child subrecord,are strings.  Here is an example of that element in two records:
Quote:
12436;2007/09/19;2007/09/12;0000/00/00;;MILLAR HOUSE;;OverDue;;;GROVE ROAD 19;MILLAR, SCOTT;MW2486

12433;2007/09/12;1899/12/30;0000/00/00;;HOUSING NZ BONNETTS GARAGE;;OverDue;;;BONNETTS ROAD;HOUSING NZ;IMAN7203
.  (Yes, that 1899 is an error). 
In this case, there are two dates that are actual,in the second and third positions.  One other date is empty, in the fourth position.  Entering 2007/09/12 into the RetrieveSpecelement on the Parent record will result in both of these records showing up in the tableview subform.  But it is desired to only show records if the third position has the date of 9/12.  That is why I am suggesting grabbing the value using a formula that  gets the value of the third position in the "array".

5.  None of the "normal" rules about delimiter apply, because we are not using a delimiter in the RetreiveSpecElement, we are only using the string "2007/09/12".  The "delimiters" in the Child KeyWord element are the normal semicolons used for KeyWord elements.

6. Again, I have probably added more confusion.  That tends to happen when the complex is put into words without visual aids.  The best way to understand this is to look at it.  Again, unconventional, may not work in all cases, but is working good right now.  Just need, in some cases, to be specific about the element position to look at, vs. using the whole KeyWord values string as normally expected.  It's not my database to share, but maybe drastixnz will share a screen shot of the Parent record showing the keyword element in the subform.  That may be helpful.

7.  And, although interesting, I think that I would eliminate the Parent record completely.  Would make the subform records a normal top level database, and would make multiple views, form and tableview, for the records, using the normal retrieve specs.  And move a lot of the buttons on the existing Parent form to the new forms needed when the subforms become top level forms again.

Confused enough?  Enjoy, thanks for your explanations of "normal" behavior.



  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Searchs on a Keyword field and a thank you.
Reply #10 - Sep 24th, 2007 at 2:57pm
Print Post Print Post  
Bob_Hansen wrote on Sep 21st, 2007 at 11:44pm:
3.  I wonder if you and I may be using terminology differently also.  When I am talking about a ChildLink, I mean the element on the subrecord that may contain a match that is defined by the value in the element on the Parent record, which I referred to as the RetrieveSpecelement.  In any case, at first look, you say "What is going on here?"  But after you dig in and do an autopsy, you see a very creative approach.  Whether this is an accident, or be design, I did not pursue.


When you say ChildLink I read it as Child Key Element and I read RetrieveSpecelement as Parent Key Element. Different terms but the same concept.

Quote:
4.  The dates in the KeyWord element, on the Child subrecord,are strings.  Here is an example of that element in two records:
Quote:
12436;2007/09/19;2007/09/12;0000/00/00;;MILLAR HOUSE;;OverDue;;;GROVE ROAD 19;MILLAR, SCOTT;MW2486

12433;2007/09/12;1899/12/30;0000/00/00;;HOUSING NZ BONNETTS GARAGE;;OverDue;;;BONNETTS ROAD;HOUSING NZ;IMAN7203
.  (Yes, that 1899 is an error). 
In this case, there are two dates that are actual,in the second and third positions.  One other date is empty, in the fourth position.  Entering 2007/09/12 into the RetrieveSpecelement on the Parent record will result in both of these records showing up in the tableview subform.  But it is desired to only show records if the third position has the date of 9/12.  That is why I am suggesting grabbing the value using a formula that  gets the value of the third position in the "array".


What I'm trying to say though Bob is that Sbasic commands can not be used in this case to get the value of the child key element to do the link as the linking is done internally in Sesame. Think of it in terms of a normal Keyword search. If you type Bob into the retrieve spec, Sesame is going to give you every record where Bob appears in the Keyword field as a Keyword. It's the same thing with the subform link.

Quote:
5.  None of the "normal" rules about delimiter apply, because we are not using a delimiter in the RetreiveSpecElement, we are only using the string "2007/09/12".  The "delimiters" in the Child KeyWord element are the normal semicolons used for KeyWord elements.


In order to specify that you want that string value to only appear in the third position of the value in the Child Key, you are either going to need to use delimiters or tag the start of each keyword with a unique identifier. In either case Every "normal" rule of the Search criteria, including the ";" apply to the value that is in the Parent Key element as it is the Search syntax.

Quote:
6. Again, I have probably added more confusion.  That tends to happen when the complex is put into words without visual aids.  The best way to understand this is to look at it.  Again, unconventional, may not work in all cases, but is working good right now.  Just need, in some cases, to be specific about the element position to look at, vs. using the whole KeyWord values string as normally expected.  It's not my database to share, but maybe drastixnz will share a screen shot of the Parent record showing the keyword element in the subform.  That may be helpful.


I've got an older copy of it here before it was switched to a keyword field, but the design is roughly the same. Again to specify the position of the Key you'll either want to switch the delimiter or add a Unique Identifier or a Tag to each Key value.

Quote:
7.  And, although interesting, I think that I would eliminate the Parent record completely.  Would make the subform records a normal top level database, and would make multiple views, form and tableview, for the records, using the normal retrieve specs.  And move a lot of the buttons on the existing Parent form to the new forms needed when the subforms become top level forms again.


That would be the approach I would take to this as well, but the world would be rather boring for me if every user did the same thing in the same way.

Quote:
Confused enough?  Enjoy, thanks for your explanations of "normal" behavior.


Actually I'm hardly confused at all by this one. You should see some of the things I get to figure out. It takes a lot now to confuse me when it comes to software. Now other aspects of life, That is where I get confused.  Wink

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged