Forum Discussion
Multiple lists with phrases for keywords
- 4 years ago
Here's one way to do it in the query editor. To see how it works, just create a blank query, open the Advanced Editor and replace the text there with the M code below. You can reference your keywords list instead of the hard-coded one shown.
let Source = Table.FromRows( Json.Document( Binary.Decompress( Binary.FromText( "i45Wys9TSFTIyC8tTlWK1YlWKs8syQAK5MIFwPJJ+YklyNLpMD5Y1gnMiwUA", BinaryEncoding.Base64 ), Compression.Deflate ) ), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Phrase = _t] ), #"Changed Type" = Table.TransformColumnTypes(Source, {{"Phrase", type text}}), #"Added Custom" = Table.AddColumn( #"Changed Type", "Custom", each let keywords = {"boat", "mouse"}, thisphrase = [Phrase], foundwords = List.Select( keywords, each Text.Contains(thisphrase, _, Comparer.OrdinalIgnoreCase) ) in if List.Count(foundwords) > 0 then "Y" else "N" ) in #"Added Custom"Pat
Anonymous for a starter can you provide sample data and desired output, please?
- Anonymous4 years agoNot applicable
The intent here is to categorize tickets that are in flight, since additional categorization is only done upon ticket resolution.
An example of what would be in the ticket's short description can be something like "Microsoft Teams - calls are redirecting to voicemail directly" or "Unable to hear via headset on teams" and I need to match it with things in the Lists, e.g. "Redirecting to voicemail" or "unable to hear." But so far it only works if my list entries are one word e.g "redirect" but as you can see, it gets tricky and inaccurate trying to match just a single word. I need to match phrases.
Desired output at its simplest is just a hit on the List's name, identified in a custom column. The Position syntax works, its just that I'm not getting any hits at all if my List has entries that are many words long and not just one word.
My first question here is regarding whether or not multiple words can be used in a List's row, e.g. "installation stuck" as detailed in my OP. If they can be used, I'd love to figure out why what I'm doing doesnt work with them, but if its just a limitation of Lists then ok I can move on from here and try other methods.
- Anonymous4 years agoNot applicable
I thought this would be a relatively simple question to answer, nobody knows whether a List can have multiple word entries or must a List have single worded entries?
- Anonymous4 years agoNot applicable
Right, so I guess this one can be filed alongside How many licks does it take to get to the center of a tootsie roll tootsie pop...