Composition

Composition can be defined as looking at a particular measure compared to the whole.

For example, In a "Sales by Region" chart, the sales for each singular region would be a discrete value while the total sales across all countries would be the "Whole".

Total sales can be divided into "Relative shares" for each region. Having information on "Relative Sales Percentages" as compared to the total sales has a greater impact rather than viewing just the plain sales figures. Eureka moments are much more likely when people use a tool to answer their own questions, which is a core belief behind the design of Qlik Sense.

As with everything else, data composition can be visualized in multiple ways. Understanding what you are trying to achieve will eventually dictate the best choice of visualization.

For example, depending on what matters, each of the following points will favor a different form of visualization:

  • Relative differences
  • Relative and absolute differences
  • Share of the total
  • Accumulation to the total (or subtraction)
  • Breaking down components of components

As such, each example in the next four recipes will be supported by a goal, questions, and an analysis description, which is as follows:

  • Goal: As a business analyst, I want to report on the best regions to focus our marketing strategy on
  • Question: I want to see how our total revenue is shared this year across the various regions
  • Analysis: How the total revenue is divided per region and if it is performing positively

Getting ready

Downloading the source files:

Downloading the example code

Tip

You can download the example source files from your account at http://www.packtpub.com, for all Packt books that you have purchased. If you have purchased the book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Use the following steps to get started:

  • Download Chapter 2 - Sales.qvf application from the Packt Publishing website
  • Save the application at the following location: C:Users<user>DocumentsQlikSenseApps
  • Open the application though the Qlik Sense hub

How to do it…

  1. Click the button in the top right-hand corner in the application overview and click the Create New Sheet button. Name this sheet as Composition.
  2. Go to the charts asset pane How to do it… and double click the line chart button How to do it….
  3. Add the following measure (m) and dimensions (d) in the same order as follows:
    (m) Sum(Sales)
    (d)  Month
    (d)  Region
  4. Select Area from the properties pane under the Appearance | Presentation menu.
  5. Finally, tick the Stacked area box. The following screenshot is an example of the final visualization:
    How to do it…

How it works…

Enabling the right property settings can turn a line chart into a stacked area chart. This clearly shows the differences when we analyze the relative and absolute composition of many time periods, as shown in the preceding example. If you had less time, say the last 3 years, then you would use the same approach, however; you will change the chart type to Bar instead of Line as the magnitude of change is more important than the change trend.

There's more…

When looking at the composition in terms of accumulation or subtraction from the TOTAL, a good option for representation is the waterfall chart. If the only important differences are the relative differences are, then write your calculation as a percentage of Total.

To achieve this, follow the following steps:

  1. Replace the Sales expression from the preceding recipe with the following:
    Sum(Sales) / sum( TOTAL <Month> Sales).
  2. Once we define the preceding measure, we will notice that just below the expression box for the measure, we get a dropdown for number formatting. Under this dropdown, change the number format to Number. Next we define the exact format of the number. To do this, switch off custom formatting and then under the dropdown below that select Formatting representation as 12%. This will produce the following 100 percent stacked area chart:
    There's more…
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset