I was recently poking around in the QlikView 11 demo “Social Media Data Analysis“. This app was first brought to my attention in the excellent blog post “Use of a Silent Legend” by Jennell McIntire. I like how color is used to quickly create linkage between elements on the sheet. It’s one of my favorite tips.
Looking at the mechanics of the color & object construction, I thought that while fine for a demo, there were a few things I would do differently. One item in particular — the Company listbox — stood out because of a new technique available in QV11.
The listbox contains a color chip for each Company that maps to the color used in the charts. Very effective.
The color chips are constructed as 6 individual Text Objects. This is maybe the only possible way to get that particular effect in a V10 listbox.
However, that means that I, the challenged artist, have to line those boxes up and keep them aligned. It also means that I have to be very sensitive to the contents of the listbox changing.
V11 introduced Listbox Expressions which opens up a new option. I took the individual color boxes and put them in jpg files. I bundle loaded (embed in the qvw) the images with this script:
Images: bundle info load * inline [ Company, image Company A,image\Square_Orange.jpg Company B,image\Square_Blue.jpg Company C,image\Square_Green.jpg Company D,image\Square_Brown.jpg Company E,image\Square_Red.jpg My Company,image\Square_Purple.jpg ];
Next step was to add this Expression to the listbox:
='qmem://Company/' & Company
and select “Image” for the Expression Representation.
And now my color chips are an integral part of the listbox. Also, the chips now disappear for excluded values which is consistent with the visual behavior of the rest of the sheet.
I won’t be surprised if commenters come up with an even better way 🙂
-Rob
Yes, visual clues are nice. I’ve made the same thing but instead of pictures i used the traffic lights. No need to make and load images into QlikView. /Anders
Hi Anders,
These are no visual cues per se, but color identities. Your traffic light gauge is an interesting idea. I suppose the idea would be to assign each of the 6 colors as a gauge segment and assign a segment number to the Company? I like it!
I solved this with a straight table instead.
A straight table works nice as a legend, but I’ve never been able to get full listbox function out of it.
Rob, I tried with straight table. The only issue with straight table is, if you make any selection it hide the associated data. So we use dummy Set expression with ignore selections to get LB functionality.
Above options are really good to know but when I have slider for list box… may be I need to go for only option of Straight table.
Hi Rob,
thanks for the great blog post.
I used a similar solution some days ago for a google maps scatter chart solution addition to change between different KPIs.
I also used the straight table solution . In order to come close to a normal listbox I added some background color for the Dimension:
=
if(%KPI=’Sales Units’,
rgb(0,247,16),
if(%KPI=’$ Sales’,
rgb(0,247,16),
if(%KPI=’Transport Costs’,
rgb(0,247,16),
rgb(222,222,222)
)))
This gives the typical QlikView look and identifies which selection is active. A quite simple and effective solution which received a great customer feedback.
Listbox with traffic light guage, awesome solution!