Thursday, August 29, 2013

Map It!

My youthful wrinkles and gray hair have not spared me from the horrible anguish of ageism perpetrated against me. So, to prove you youngsters wrong and that I'm hip to that jive, let me quote from the philosopher of your generation,  Selena Gomez:

"The trips we dreamed of takin', the tags left on the map, what happened to that? What happened to that?"


While I refuse to listen to it, I'm sure that it's a national treasure. So, Carpe Diem Baby, hug the curve, lose the time, tear the map, and shoot the sign.


My segue skills are almost exhausted, so here it is. Add a map to your dashboard. Just do it.



Groundwork

This technique uses an extension object created by Brian Munz. It can be found, for free, on the QlikMarket. Extensions allow developers to create new objects (maps, charts, etc) that don't exist in QlikView. Extensions only run in WebView. Developing your apps in WebView sucks, so you will be switching back and forth a lot.

Step One - Download and Install the Extension

Download it at http://market.qlikview.com/qlikview-svg-map.html. The file is a zip file. Make sure that QlikView is running, then extract it and double click on "svgMap.qar". You'll see a message box pop up:


Step Two - Add the Object

If you try to add it without switching to WebView, you haven't been listening. Switch to WebView, right click, and you'll see a different dialog box. Click on New Sheet Object.


A new dialog box will open. Click on 'Extensions' and drag the SVG Map Extension onto the sheet.


It will look like you've messed something up.

Step Three - Build It

The extension comes with 35 maps. If you're adventurous and talented you can add more, but that's beyond this tip and my skill set. The download comes with a Word document that has good instructions, but I'll highlight a few things.
  1. For our purposes, the state map is much more useful than the county map. If you insist on counties, you'll need to make sure that your document has FIPS codes. I've created a lookup table by Zip code that you can find on my Google share.
  2. Your state field needs to be 2-digit state abbreviations, not full state names.
  3. Experiment with the Element Border. 
  4. Make useful and attractive pop-ups.
  5. Don't forget the Disabled Color. I recommend white.
  6. It doesn't always refresh on your desktop. You'll most likely need to hit control-F5 to see your changes.
  7. It doesn't have a chart title option. You can fake it by making your caption bar clear.
  8. Remember that it's a free extension and don't get mad if it's a little quirky. It's still pretty cool.

Bonus!

This extension doesn't have a legend. If you get creative with your colors - Red, Yellow, Green for bad, eh, and good - the extra work is worth it.
The key is to create a straight table and then layer it on top of the map.
  1. Create a valuelist() with the items for your legend. Use it as your dimension.
  2. For your expression, simply put a space.
  3. Define the background colors to match your map in the expression attributes
  4. Drag the expression column so that it is before the dimension
  5. Format it so that everything but the background color and dimension text is transparent.
  6. Put it someplace that makes visual sense.


Now you can play that funky music white boy, play that funky music right. Lay down the boogie and play that funky music till you die, oh till you die. Play that funky music right.


No comments:

Post a Comment