September 2, 201213 yr I am trying to define a field to produce a "text" result based on a "text fragment". Case ( Description *"Home Depot" or Description *"GENERAL PAINT" ;"Production"; ) This is a ledger. When my 'Description field contains the text "Home Depot" or General Paint" I know the field "Expense Type" will be a 'Production' expense. This automates a small part of my book keeping. Thanks
September 2, 201213 yr If you have different expense types, a better solution might be to set up a table with these types and flag the records accordingly, based on certain criteria. This would be a more robust solution than to search for description values that might change over time, or have typos. In the meantime, try Case ( PatternCount ( Description ; "Home Depot" ) or PatternCount ( Description ; "general paint" ) ; "Production" )
September 3, 201213 yr Author Eos I am not sure what you accomplish by this. What I want to achieve are records with text based identifiers, ie; Production, Office, Utilities, Shipping etc.. This way the ledger can be summarized accordingly. Every month I import my bank statements. It just seemed a time saver to create this function since these suppliers are almost always classed or define as mentioned. Is it possible to create this calculation? Thanks
September 3, 201213 yr Author PatternCount as I understand it gives me a numeric count of the number of occurrences. I want a text result. Your calculation does not give me the result I am looking for.
September 3, 201213 yr PatternCount as I understand it gives me a numeric count of the number of occurrences. I want a text result. Your calculation does not give me the result I am looking for. Obviously your understanding of PatternCount is not complete. In this case, the calculation checks if one of the two strings appears in the other field; if so, it sets the result of the field to “Production“, or leaves it empty otherwise - which, if I recall correctly, is what you're after. The numeric result of PatternCount () is merely used as a Boolean truth value, and is not the final result of the field calculation.
September 3, 201213 yr Author Yes, I would say yes. I am trying to have these keywords entered into the field automatically.
September 3, 201213 yr Your calculation does not give me the result I am looking for. Why don't you provide a specific example - such as: the Description field contains "...", the calculation returns "..." instead of the expected "...".
September 3, 201213 yr Also BuckBuck, the field should be type of CALCULATION set to text result and not auto-enter text (unless you need ability to over-ride the result). If you have existing data or sample text it won't change automatically if the field is text with auto-enter (do not replace). Is that why it appears not to work? :-)
September 4, 201213 yr Author Thank you for the suggestions. In the end PatternCount works however I needed to apply LaRetta's comment regarding 'auto complete'.
Create an account or sign in to comment