4 Replies Latest reply on Mar 29, 2018 4:23 PM by swaroop.gantela

    Use a word cloud to filter statements?

    Justin Oeffler


      I'm working with some data, and I have a word cloud generated from the words contained within statements.  On a dashboard, I'd like to be able to click a word in the word cloud, which then filters the sheet with the statements, so you only see the statements that contain that word.  The closest I've been able to get is by setting a parameter to read from my 'word' field, so you can have a drop-down to select a word to filter by, but that isn't nearly as intuitive as just clicking the word from the cloud, especially when my real data has about 1400 words right now, and that's going to grow as time goes on. 


      It doesn't appear that there's a way to have an action set a parameter, if I'm reading other posts correctly, and my google-fu has not fared well in finding a solution to this.  Is there anyone out there that may have a clever way (or not clever, I'm not picky) to accomplish this?


      I've got a sample attached that matches how my data is laid out.  I greatly appreciate any insight that anyone may have on this!

        • 1. Re: Use a word cloud to filter statements?



          Well, you said you weren't picky ...


          This in all likelihood won't suit your setup as it is heavily reliant upon manipulation of the datasource.

          But maybe it can give an idea.


          I altered your data in Excel in order to create a statement on each row, and then used the

          "Text to Columns" function to split each statement into its component words, one word to a column.

          Then I labelled the Columns as Word1, Word2, etc.

          When I pulled this into Tableau, I pivoted all the WordColumns into one.

          (with some work, this splitting and pivoting can also be done within Tableau:

          Pivot data that has been split - how to pivot )


          Then I made a lower case version of the words (for linking purposes).


          This process then obviated the need for a separate frequency sheet,

          as the word size in the cloud was simply SUM([Number of Records]).


          On the Statement Sheet, each row had the original [Statement],

          and on the Detail shelf was the pivoted [LowerWord]. (To get rid of the

          extraneous right column, I used a Gantt chart without color).


          Then the Dashboard action was just directly connecting [LowerWord] to [LowerWord].

          (On the word cloud, [Word] was on the Text shelf, and [LowerWord] was on Details.)


          So the questions are:

          - whether you have the freedom to manipulate your data as such,

          -how many words long is the longest statement,

          -if your datasource is of a type that allows for pivoting.


          If this isn't feasible, will look into other methods.


          Please see the workbook attached in the Forum Thread.



          1 of 1 people found this helpful
          • 2. Re: Use a word cloud to filter statements?
            Justin Oeffler


            Thanks for putting the time into this!  I'm going to give it a go, though I'm not sure how well it'll do.  My statement length varies quite a bit, ranging from one word all the way up to 139.  But I've also got Alteryx at my disposal, so it won't be too hard to change the prep of the data before getting to Tableau.  I'll report back with my findings on how well this works out.  Thanks again! 

            • 3. Re: Use a word cloud to filter statements?
              Justin Oeffler


              Well, we tried.  This does work.  It just doesn't work well with my data set, simply because of how many words, and the variety of words, I have.  I appreciate you taking the time to help, though!  The rest of the dashboard that this is built into functions well, I was just hoping to tack this on as an extra layer of interactivity, but I have to move on and not spend all my time trying to solve for this one thing.  When I get some free time I may revisit this, just unsure when that will be.


              Again, thank you so much for the help!

              • 4. Re: Use a word cloud to filter statements?



                Here's another attempt.

                Since you do have the complete list of individual words,

                you can try a cross-join between the statements sheet and the word sheet,

                joining on a calculated field of 1, as described here:

                CROSS JOIN with Tableau's join dialog


                This creates every combination of every statement with every word.

                This can then be filtered down to just the pertinent ones.

                Ideally, one would have liked to use a filter like:



                but unfortunately, one isn't immediately able to get an exact match,

                so the word "i" would show up positive for a statement with "fish" because

                the letter 'i' is contained therein.


                I added some extra conditionals, but more may be needed:



                CONTAINS(LOWER([Statement]),LOWER([Word])+" ")


                CONTAINS(LOWER([Statement])," "+LOWER([Word])+".")


                CONTAINS(LOWER([Statement])," "+LOWER([Word])+" ")


                CONTAINS(LOWER([Statement])," "+LOWER([Word])+"?")


                Please see the workbook attached in the Forum Thread.