Page 2 of 4 FirstFirst 1234 LastLast
Results 16 to 30 of 49
  1. #16
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,046

    Dual post... removed

  2. #17
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,046
    Orange -- thank you for the feedback. I'm excited to learn this is a useful function.

    Ultimately, our analysis team needs to evaluate certain pattern within our ETL business rules. Naturally, my example sentences were pure dummy data but (hopefully) helped to illustrate process.

    Again, thanks for pointing out the 3rd string criteria... I appreciate it.

  3. #18
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,938
    PMFJI in here, but couldn't you just use the Split() function and then check it's UBound() value.?
    If one exists, UBound() would return 1, if two, then 2, etc?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #19
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    I agree welshgasmman, but that doesn't provide the value of the substring(s) --at least I don't see how it would/could.

  5. #20
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,046
    Thank you for chiming in welshgasmman -- as Orange pointed out, the goal is to obtain the substring (or multiple substrings) which resulted in the record to be flagged as TRUE.

  6. #21
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Once you start retrieving the values you might find that it's less perfect. There are 2 instances of "is " but you're under the impression that it is True because of the "ant" in elephant (which was also missed BTW). Another example of that is that there are 2 instances of "the" in the lion string, which I think was also overlooked. You will also pick up instances where 2 letters are coupled with punctuation:
    This is getting complicated. It might make one frustrated.

    So now what? Exclude any trio of characters where at least one of them is punctuation? Eliminate common words like "the"?

    EDIT
    this is almost intriguing. Just saw another one: " li". Can you find it?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #22
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Good points micron. This is where the details of the requirement are important.
    What exactly is in? What is questionable/debatable?

  8. #23
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Quote Originally Posted by orange View Post
    Good points micron. This is where the details of the requirement are important.
    What exactly is in? What is questionable/debatable?
    Exactly. It all seems clear until you start digging in to it. This is where being detail oriented is an advantage (usually it was my disadvantage). The requirements need more thought. Whether or not to include numbers is also relevant.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  9. #24
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,938
    Quote Originally Posted by skydivetom View Post
    Thank you for chiming in welshgasmman -- as Orange pointed out, the goal is to obtain the substring (or multiple substrings) which resulted in the record to be flagged as TRUE.
    Those substrings would be held in the variable used for the Split?

    Without the string being searched for of course, but easy enough to put back together.?

    Anyway it was just a thought.?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  10. #25
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Quote Originally Posted by Welshgasman View Post
    Those substrings would be held in the variable used for the Split?

    Without the string being searched for of course, but easy enough to put back together.?

    Anyway it was just a thought.?
    I'm intrigued by that. Can you post an example?

    Here's where I have arrived. I would forget about the count as the number of instances of a word will be variable so you don't know how many counter variables you need and it wouldn't be worth the effort to make that dynamic (and I doubt you could). In other words, if 3 instances are found you need a value for each. If 4 then 4 values and so on.

    SourceValue Expr1
    The African elephant is large; it is also a very elegant mammal. ele,ant
    There was a lion in the linen closet. The
    The lion and the lioness are busy with their cubs. The,lio,ion
    Dogs are man's best friend.
    A chinchilla is a small rodent. chi

    EDIT
    If anyone sees a matching trio that the code missed or any other potential issues please let us know. I foresee an issue with O'Leary and the like.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  11. #26
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,046
    Micron -- thank you for your additional comments and thoughts/recommendations.

    Ultimately, I want to say that we will probably use character strings > 3. In instances like record #5, I can go up all the way to 8 characters and will pick up 2 dups.

    Also, excellent point of eliminating punctuation and common words. Not sure where to even begin creating such dictionary... "the, these, their" may need to be included. Ideally, if we had a dictionary, would it be feasible to have a separate function that includes the common words? Then, once a new "sentence" (i.e. ETL business rule) is **falsely** flagged as TRUE), I could merely go back into the dictionary and add the new word in order for the record to be flagged as FALSE.

    And, yes, characters such as commas, spaces, periods should be excluded. Ultimately though, this pretty much sums up the requirements for this function.

    If you have any thoughts on how to tweak the VBA, I certainly would welcome your assistance in this coding effort.

  12. #27
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,046
    Micron -- copy to NOT include the frequency... your comment makes sense.

    You've already gotten far ahead with that 2nd column. Would you mind posting the VBA code for it?

  13. #28
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    Whilst we are all straining our eyes, another possibly overlooked repeat string is 't i' in sentence 3. There are probably others even now
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  14. #29
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,046
    Isladogs -- great catch! "t i" that is!

  15. #30
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Quote Originally Posted by isladogs View Post
    Whilst we are all straining our eyes, another possibly overlooked repeat string is 't i' in sentence 3. There are probably others even now
    Not if you exclude non-alpha characters?
    @skydivetom - I will be back with the code and comments on it.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Page 2 of 4 FirstFirst 1234 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 08-27-2020, 06:50 AM
  2. Replies: 8
    Last Post: 07-23-2017, 02:04 PM
  3. Replies: 3
    Last Post: 09-22-2016, 11:16 AM
  4. Find a record that contains a word in a string
    By knowshowrosegrows in forum Queries
    Replies: 2
    Last Post: 11-17-2015, 11:35 AM
  5. Replies: 2
    Last Post: 11-15-2013, 09:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums