Pular para o conteúdo principal

(O) Criando um gráfico tipo "Stephen Few" no QlikView

This chart as a replacement for a traditional gauge.
A traditional gauge takes up a large amount of space to encode, usually, only one value. A bullet chart is linear and can encode more than one value.
The main components of a bullet chart (from Stephen Few's perceptualedge.com)
are as follows:
  • A text label
  • A quantitative scale along a single linear axis
  • The featured measure
  • One or two comparative measures (optional)
  • From two to five ranges along the quantitative scale to declare the featured measure's qualitative state (optional)
There is no native bullet chart in QlikView. However, we can create one by combining a couple of objects. Items 1, 2, 4, and 5 can be achieved with a linear gauge chart. The bar, item 3, can then be overlaid using a separate and transparent bar chart.

Hands-On

  •  Load the following script:

LOAD * INLINE [
    Country, Sales, Target
    USA, 1000, 1100
    UK, 800, 1000
    Germany, 800, 700
    Japan, 1000, 1000
];
  •  Add a new gauge chart. You should add a title and enter text for Title in chart. Click on Next.
  • There is no dimension in this chart. Click on Next.
  • Enter the following expression: Sum(Target)
  • Click on Next.
  • There is no sorting (because there is no dimension), so click on Next.
  • On the Style tab, select a linear gauge and set the orientation to horizontal.Click on Next.
  • There are a few changes needed in the Presentation tab:
     
  • There should be two segments by default, add a third segment by clicking on
    the Add button. The settings for each segment are as follows:
  • Apply appropriate colors for each segment (for example, RAG or Dark/Medium/
    Light gray).
  • Click on Finish.
  •  Most of the bullet chart elements are now in place. In fact, this type of linear chart may be enough for some uses. Now we need to add the bar chart.
  • Add a new bar chart. Don't worry about the title (it will be hidden). Turn off Show Title in Chart. Click on Next.
  • There is no dimension in this chart either. Click on Next.
  • Add the following expression: Sum(Sales)
  • Click on Next.
  • There is no sort (as there is no dimension). Click on Next.
  •  Select a plain bar type. The orientation should be horizontal. Leave the style at the default of Minimal. Click on Next.
  •  Set the following axis settings:
  •  Click on Next.
  •  On the Color tab, set Transparency to 100%. Set the first color to a dark color.
    Click on Next.
  • Continue to click on Next until you get to the Layout tab. Set the shadow to No
    Shadow and the border width to 0. Set the Layer to Top. Click on Next.
  • Turn off the Show Caption option. Click on Finish.
  •  Position the bar chart over the gauge so that the scales match (Ctrl + arrow keys are useful here). The bullet chart is created.
 Conclusion

By matching the Static Max setting of the bar and the gauge (to the sum of target * 1.2), we ensure that the two charts will always size the same. The 1.2 factor makes the area beyond the target point of 20 percent of the length of the area before it. This might need to be adjusted for different implementations.

It is also crucial to ensure that the layer setting of the bar chart is at least one above the layer of the gauge chart. The default layer (on the Layout tab) for charts is Normal so, in that situation, you should change the bar chart's layer to Top. Otherwise, use the Custom option to set the layers.

Using techniques such as this to combine multiple QlikView objects can help us create many other visualizations.

Thanks and see you on the next post!

PS: This article has adapted from the original: "Discover the strategies needed to tackle the most challenging tasks facing the QlikView developer (Stephen Redmond)"

Comentários

Postagens mais visitadas deste blog

(A) Data Science in Practice with Python

The top trending in Twitter or other social network is the term “data science”. But ...
What’s the data science? How do real companies use data science to make products, services and operations better? How does it work? What does the data science lifecycle look like?  This is the buzzword at the moment. A lot of people ask me about it. Are many questions. I’ll try answer all of these questions through of some samples.

Sample 1 - Regression

WHAT IS A REGRESSION? This is the better definition what I found [Source: Wikipedia] - Regression analysis is widely used for prediction and forecasting, where its use has substantial overlap with the field of machine learning.
HOW DOES IT WORK? Regression analysis is also used to understand which among the independent variables are related to the dependent variable, and to explore the forms of these relationships. In restricted circumstances, regression analysis can be used to infer causal relationships between the independent and dependent variable…

(A) Tucson Best Buy Analysis

“Data! Data! Data!” he cried impatiently.  “I can’t make bricks without clay.” —Arthur Conan Doyle
The Ascendance of Data

We live in a world that’s drowning in data. Websites track every user’s every click. Your smartphone is building up a record of your location and speed every second of every day. “Quantified selfers” wear pedometers-on-steroids that are ever recording their heart rates, movement habits, diet, and sleep patterns. Smart cars collect driving habits, smart homes collect living habits, and smart marketers collect purchasing habits. The Internet itself represents a huge graph of knowledge that contains (among other things) an enormous cross-referenced encyclopedia; domain-specific databases about movies, music, sports results, pinball machines, memes, and cocktails; and too many government statistics (some of them nearly true!) from too many governments to wrap your head around.
Buried in these data are answers to countless questions that no one’s ever thought to ask. In…

(A) Data Science in Practice with Python - Sample 2

In this post I'll explain what is a recommender system, how work it and show you some code examples. In my previous post I did a quick introduction:

Sample 2 - Recommender System

WHAT IS A RECOMMENDER SYSTEM? A model that filters information to present users with a curated subset of options they’re likely to find appealing.
HOW DOES IT WORK? Generally via a collaborative approach (considering user’s previous behavior) or content based approach (based on discrete assigned characteristics).

Now I'll get into in some concepts very important about recommender systems.

Recommender System in Details:

We can say that the goal of a recommender system is to make product or service recommendations to people. Of course, these recommendations should be for products or services they’re more likely to want buy or consume.

Recommender systems are active information filtering systems which personalize the information coming to a user based on his interests, relevance of the information etc.…