Keith Shelton Posted February 15, 2001 Posted February 15, 2001 Hopefully, a simple problem for someone. I wish to apply a wildcard character or equivalent when using an 'If' instruction in a calc for the same field containing similar info, e.g. fields contain 'Door Large' or Door Small' or 'Door Medium' etc. How can I ask FM to identify all fields containing 'Door'? Thanks in advance. K
Keith Shelton Posted February 15, 2001 Author Posted February 15, 2001 Sorry, should have explained a little more. It is part of a product list and I wish to have another field coded (automatically with a calc) with a product family code, e.g. 'D' for doors, whatever the type of door. This code field reads the full product field and codes itself automatically with a family code, using the If(Product Field = etc. It works OK but I have to tell it each product name in full instead of just picking up the key word. Hope this is clearer. I am not highly experienced and there could well be a better way of doing it. Thanks again.
BobWeaver Posted February 15, 2001 Posted February 15, 2001 You can use the PatternCount() or Position() functions to find a chunk of text in a bigger chunk of text. You could do something like: Category = case( PatternCount(Upper(ProductName)),"DOOR"),"Door", PatternCount(Upper(ProductName)),"WINDOW"),"Window", "Other") You can add as many items to the above calculation as you need. If it doesn't find a match, it will return "other" Having said this, this may not be the best way to achieve what you are trying to do. Is is possible that some product names may have more than one of the keywords in it? For example, could you have a product called "door with window in it" or some such thing?
Kurt Knippel Posted February 16, 2001 Posted February 16, 2001 quote: Originally posted by Keith Shelton: Hopefully, a simple problem for someone. I wish to apply a wildcard character or equivalent when using an 'If' instruction in a calc for the same field containing similar info, e.g. fields contain 'Door Large' or Door Small' or 'Door Medium' etc. How can I ask FM to identify all fields containing 'Door'? Thanks in advance. K What are you trying to do? Do you want to see a found set of record which contain the word "door" in a given field? If this is the case, simply do a find and put "door" as the criteria into the appropriate field. It will find all of the records in which "door" is a word in that field. ------------------ =-=-=-=-=-=-=-=-=-=-=-=-= Kurt Knippel Consultant Database Resources mailto:[email protected] http://www.database-resources.com =-=-=-=-=-=-=-=-=-=-=-=-=
Recommended Posts
This topic is 8784 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