Skip to content

Instantly share code, notes, and snippets.

@jroakes
Last active March 22, 2021 16:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jroakes/248eefdfdac92e24195e4f9a3afb623e to your computer and use it in GitHub Desktop.
Save jroakes/248eefdfdac92e24195e4f9a3afb623e to your computer and use it in GitHub Desktop.
Use NLTK Stopwords List to group similar text fields in Google Data Studio
REGEXP_REPLACE(REGEXP_REPLACE(REGEXP_REPLACE(LOWER(<field_to_convert>), "[^\\w]+", " "), "(\\ |^)(me|my|the|of|myself|we|our|ours|ourselves|you|your|yours|yourself|yourselves|he|him|his|himself|she|her|hers|herself|it|its|itself|they|them|their|theirs|themselves|what|which|who|whom|this|that|these|those|am|is|are|was|were|be|been|being|have|has|had|having|do|does|did|doing|a|an|the|and|but|if|or|because|as|until|while|of|at|by|for|with|about|against|between|into|through|during|before|after|above|below|to|from|up|down|in|out|on|off|over|under|again|further|then|once|here|there|when|where|why|how|all|any|both|each|few|more|most|other|some|such|no|nor|not|only|own|same|so|than|too|very|can|will|just|don|should|now|i|t|s)(\\ |$)", " "), "[\\s]{2,}", " ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment