Читать книгу QlikView Your Business - Troyansky Oleg - Страница 17
II
Learning the Core Techniques: Sales Analysis
Chapter 4
Visualizing Sales Analysis in QlikView
Developing Simple Charts in QlikView
ОглавлениеCharts are definitely the heart of QlikView visualizations. Charts carry most of the analytical value in any QlikView dashboard. The other sheet objects serve as accessories and accents, which merely support the main message communicated in charts. Needless to say, mastering the craft of developing insightful charts is a huge part of becoming a QlikView professional.
QlikView 11 supports 13 types of charts – 10 types of graphs, 2 textual objects, and a variety of gauges. We will cover all the available chart types throughout this book.
In this section, you learn the basics of QlikView charts and create the following chart types:
● Bar charts
● Line charts
● Pie charts
● Straight tables and Pivot tables
Main Components of QlikView Charts
QlikView charts can be divided into three logical groups:
● Graphical charts, such as bar charts, line charts, and several other graphical chart types.
● Non-graphical charts, such as straight tables and pivot tables (you will discover that these can also include some graphical elements).
● Gauges, such as speedometers and dials, that are used to represent single KPIs in a graphical form.
The various charts may look different from each other, yet they share a set of important common characteristics. For this reason, all of them are called “charts” and are configured in a similar way. The next sections describe the two main characteristics shared by all charts – expressions and dimensions.
Chart Expressions
Charts communicate aggregated information, presented in a variety of forms. The main component of a chart that defines what the measure is and how it should be calculated is called an expression. Simple charts typically visualize a single expression, while more complex charts may have multiple expressions.
Since charts always present aggregated data, a chart expression should always contain one or more aggregation functions. The most commonly used aggregation functions are sum()
, count()
, avg()
, min()
, and max()
(many other aggregation functions can be found in QlikView’s Help section). All of these functions accept at least one parameter – an expression that will get calculated at each detailed row and then aggregated up. For example, the following expression:
will simply summarize the values of the field [# Sales Amount]
for all available rows of data. This expression:
instructs QlikView to subtract the two fields at the detailed level and then summarize the result. Let’s compare this expression to the following expressions:
This time, the two fields are aggregated separately, and then one summarized result is subtracted from the other. The end result of the two expressions is virtually identical (there might be subtle differences that have to do with missing values, but you can ignore them at the moment).
However, the following two expressions will produce completely different results, despite the similarities:
versus
The first expression calculates the average margin percent, and it’s accurate – the summarized Cost of Goods Sold (COGS)
is subtracted from the summarized Sales Amount
, and the result is divided by the summarized Sales Amount
. Conversely, the second expression, while valid syntax-wise, is logically incorrect. The margin percent calculation is enclosed in a single aggregation function, therefore it is performed at every detail line, and then the resulting percentages are summarized. Even if you replaced sum()
by avg()
, the result would be different from the formula above, and most likely be different from the expected result.
To summarize this brief introduction to chart expressions, let’s emphasize the two points that you’ve just seen:
● Chart expressions should always be defined with an aggregation function.
● When multiple fields are involved in a calculation, it’s important to determine the order of operations – which calculations need to happen at a detailed level and which calculations need to apply to the aggregated results.
Chart Dimensions
If charts always show aggregated data and chart expressions define what aggregation functions should be used, then dimensions describe the level of aggregation for the chart.
Конец ознакомительного фрагмента. Купить книгу