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.
Brian, this works fine for me, but just tried to install it at a customer and he gets all the error's listed above, JS errors, word property greyed out etc.. He is running QV11 with the latest Server Pack, I'm in a Windows 7 environment, his is on a Windows Enterprise Server. There are two sets of errors as we tried it on two of their environments .. both different .. any ideas? After I click past the error's I can go into the properties but the Word dimension is greyed out and if I insert a measure it doesn't store it..
Server 1 Error's:
Server 2 Error's:
Hi Brian,
The plugin works great know - reinstallining in QV 11.20 IR solved my QvAjax problem.
Now, I see al little other problem - I have a dimension with exactly 700 words. However, the most occuring word does not seem to come back in the graph. If I selected only that word, I see a white graph. Could this be a bug?
Thanks, Ernst
That's really strange. Could you tell me what the word is? Is there something different about it?
No, the only special thing is that the word occurs first in my 'Word700' table in the Word700 column, as I created that table to only have the 700 largest words in the Word Cloud.
So, the table Word700 only contains every word (that occurs most) once - maybe the first row is omitted and thus the word does not occur? A quick test shows that putting another word first in that table make that that word disappear.
Hmm, maybe this is not the case. I see now, that if I move the object, the word cloud is rerendered. I see that the most occuring word (which is also quite long) randomly disappears and reappears during this rendering. Is it possible the word is not shown because it is partly out of the graph?
Does everything work properly if you limit the number of words to 699? I'm wondering if I accidentally made the limit one less than I thought.
I just set the PageHeight to 701, but that does not make a difference. I guess it is that the word randomly is rendered partly outside the graph area and therefore is not shown. Moving the object causes the extension to calculate a new composition and possibly rendering the (big and long) word inside the graph area. What do you think, could this be the cause?
Wonderful extension, thank you. It looks really good.
My original reply was that the colors weren't working. However, I've since tried it in 11 SR2 and it now works (color remained black in 11 SR1, regardless of expression).
I have noticed one other bug (maybe?). The most popular keyword (i.e. the one that would be displayed in the biggest font) very often doesn't appear. If I make a selection, then go back, it does then appear. Do you know what might be causing this? At first I thought I was passing too much data to the cloud, but then I restricted it to 20 words. It's really weird that the most popular word needs a refresh or two to get it working.
Again, it's a really useful extension, so thank you!
James
Hi guys
My post that pre-dates this one seems to refer to the same problem that Ernstblaauw is having.
If you open the attached example, and then keep hitting Ctrl+R (or even if you just drag the wordcloud object around, which initiates a redraw), you'll see that the top keyword (self-service, in this case) disappears quite often.
I'm inclined to agree with Ernstblaauw, that this might have something to do with the length/size of the keyword. By replacing the most popular word with a shorter word, I noticed that this problem doesn't seem to happen.
I really like this extension but unfortunately, I can't use if properly if the most popular tag doesn't appear (since this is all important in my case - monitoring customer service 'most popular reasons for phone calls'). I've tried to look through the .js scripts but it's beyond my skills to debug them.
Hope this helps
Thanks
James
Hi again
Just to continue the story, I noticed that the 'missing word' bug appears in the Presidential Election demo app on the Qlikview website, so it seems it is a proper bug that has gone unnoticed until recently.
I have been in contact with the team that puts together these demos and they are looking into it. I also sent them the attached document, which highlights the bug (that the most popular keyword - sometimes two keywords - are very often missing from the cloud).
Once I receive word back from the Qlikview demo team, I will post here.
James