Oldsneekers Posted November 18, 2004 Posted November 18, 2004 I have two fields (each in a different TO) that can contain names of several items (0-20 or so). I want to make a script or calculation that will look for and identify any element in one field that may be in the the other. Previously I used a relationship: converting the substituting the comma and space with a paragraph mark then relating the fields to eachother. Then a script looked at the relationship; if the related field was "not empty", there must be a match, then a dialog box was activated informing the user. Is there a way to do this with scrip or calc function. I can only think of a looped series of "if pattern count" statements that goes to the first word then second word and so forth, and exits after the word number equals word count. Anything a bit more elegant? Many thanks. "It's never so bad that it couldn't get worse."
-Queue- Posted November 18, 2004 Posted November 18, 2004 Do you want to return a yes or no for any values existing in the second field or return the actual matching values?
transpower Posted November 18, 2004 Posted November 18, 2004 I can think of two methods: 1. Using Developer: create two recursive functions; the second would be called from the first. The first function would recurse over the first list. The second would recurse over the second list. The second would be called from within the first. Appropriate flags would be returned. 2. Using repeating fields: put both lists in repeating fields. In a script, loop over the repetitons of the first repeating field. For each repetition, put that value in a find in the second repeating field; if there's a match, the found set will be one or more. If there's no match for any repetition, then no records will be found. Appropriate exits can be scripted. I'm not sure, though, that these two methods are any more elegant than your proposed looping pattern count method.
Recommended Posts
This topic is 7313 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now