- QlikView for Developers Cookbook
- Stephen Redmond
- 290字
- 2021-08-13 17:08:23
Creating a waterfall chart
A waterfall chart is a type of bar chart used to show a whole value and the breakdown of that value into other subvalues, all in one chart. We can implement it in QlikView using the Bar Offset option.
In this example, we are going to demonstrate the chart showing a profit and loss breakdown.
Getting ready
Load the following script:
LOAD * INLINE [ Category, Value Sales, 62000 COGS, 25000 Expenses, 27000 Tax, 3000 ];
How to do it…
The following steps show you how to create a waterfall chart:
- Create a new bar chart. There is no dimension in this chart. We need to add three expressions:
- Once you have added the expressions, click on Finish.
- Edit the properties of the chart. On the Expressions tab, click on the + sign beside the COGS $ expression. Click on the Bar Offset option. Enter the following expression into the Definition box:
Sum({<Category={'Sales'}>} Value) -Sum({<Category={'COGS'}>} Value)
- Repeat for the Expenses $ expression. Enter the following expression for the Bar Offset:
Sum({<Category={'Sales'}>} Value) -Sum({<Category={'COGS', 'Expenses'}>} Value)
- Repeat once more for the Tax $ expression. Enter the following expression for the bar offset:
Sum({<Category={'Sales'}>} Value) -Sum({<Category={'COGS', 'Expenses', 'Tax'}>} Value)
- Click on OK to save the changes.
- The waterfall chart should look like the following screenshot:
How it works…
The Bar Offset option for bar charts allows us to calculate the start position for each of the bars, other than the 0
default value.
We use a Set Analysis
expression to easily calculate the values.
There's more…
While this example is reasonably trivial, it is reflective of a real-life example and there are many others. Using Set Analysis
functions to calculate the value for the offset is very typical.
- Microsoft Dynamics GP 2016 Cookbook
- 中國新股民必讀手冊(2015年最新版)
- 資本的眼睛
- Citrix XenApp? 7.5 Desktop Virtualization Solutions
- 基于價值增值的治理導向型內部審計研究
- VMware vCloud Director Essentials
- 會計信息化基礎(金蝶版)
- 審計綜合模擬實訓
- 企業能源審計與節能規劃
- Microsoft System Center Data Protection Manager 2012 SP1
- 審計基礎
- VMware vCenter Operations Manager Essentials
- 企業并購審查中的相關市場界定:理論與案例
- 內審兵法
- Learn Power Query