Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
A new app for the US Presidential election is being released on the QlikView Demo Site shortly, and it contains an extension for a word cloud that might be useful. It's built using this word cloud generation javascript library (built on the d3 JS library) which attempted to simulate the look and feel of Wordle:
I don't use all of the options available in this library and keep it pretty bare bones, but I imagine this extension should satisfy most use cases.
The properties are fairly straightforward:
The Words dimension is simply the list of words that will be displayed in the cloud
Measurement is an expression which controls the sizes of the words. This could be anything you'd like to measure the words against.
Color Expression is the expression which controls the color of the words. If you simply want one color, you could hardcode it to a hex or RGB color, or you could use an expression and mix two colors (using the ColorMix1 function from QlikView), or use the expression like a gauge and present any number of colors based on some range.
The Maximum Font Size and Minimum Font Size properties are simply the maximum and minimum sizes of the words.
SOME THINGS TO NOTE:
The cloud can be a bit unwieldly (or maybe crash) if you pass too many words into it, so I've set a maximum data set of 700 for this extension. To change this, edit the Definition.xml file in the extension's folder and change 700 to whatever you want in this line:
<ExtensionObject Label="wordCloud" Description="wordCloud" PageHeight="700">
The only issue this might cause is if you have 1000 words in the dimension, a random selection of 700 will be passed in, in no particular order. I've tried and tried to get the extension to sort based on the expression rather than the dimension and I think it's not possible (which may be a bug), so instead returning the top x number of words based on an expression might need to be done using set analysis, firstsortvalue, or ranking function.
I think that's it. Let me know if you run into any problems.
EDIT
I now host this extension on GitHub.
brianwmunz/wordCloud-QV11 · GitHub
Please download it from there form now on. Also, feel free to update, change, improve, etc. the extension in any way you please using GitHub.
Thanks.
QV11 SR1
Hmm my Words dimension is greyed out - am i doing something wrong? I've just done an inline load of some firstnames to try to test it.
What data should i have loaded to enable me to pick something in the Word dimension?
Has anyone got an example qvw they can post?
I've attached mine can someone see what is wrong?
No Problem - i deleted and reinstalled the extension and it works fine now
Message was edited by: Paul Nockolds
I'm getting the qvajax error too - running Windows 7 with QV 11 SR2 64-bit. Does anyone know a solution? I would love to use this one.
Brian, great extension and the timing is great for a use case I have, thanks.
An open question to anyone, is there a good way to convert a text string to individual words for use in the word cloud in QlikView?
For example, a comment string (single field in database) we'd want to analyze for recurring individual words with the word cloud.
Thanks.
I'm not able to get this one working on Windows 7 w/ QV 11 SR2 64-bit either. However, the word cloud extension at http://community.qlik.com/thread/59953 does work with this setup.
I built this extension with that same environment and it works for me. Are you running it from desktop mode or on a local QVS? What are your properties? How many words are you attempting to display? Are there any foreign characters in your words?
Hi Brian,
I was testing in desktop mode with a sample files in the forums as the election demo is not downloadable.
Perhaps you could post or direct us to a sample qvw that works with this extension so we'd make sure we're not using an incompatable word cloud extension?
Regards,
Wes
Are you trying to display more than 700 words?
If so, can you please send me a message with your email address so I can send you an extension of this that I modified to see if it works for you?
Hi , I tried the WordCloud extension on Windows Server 2008 R2 , Internet explorer version 8 .
Is there anything I can do to get this implemented ?
Regards
VR
Wes, if you replace all characters like dots, commas, etc for spaces you can then use the subfield function.
Subfield(fieldname,' ') AS Word will create a column with name Word with an entry for each word.
Thanks Daniel, I'll give this method a try.