- 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.
- Mastering Microsoft Forefront UAG 2010 Customization
- 資本的眼睛
- 讓財報說話:世界500強CFO帶你輕松讀財報(鮮讀版)
- Metabase Up and Running
- 大數據搜索與挖掘及可視化管理方案 :Elastic Stack 5:Elasticsearch、Logstash、Kibana、X-Pack、Beats (第3版)
- 非線性經濟關系的建模
- OAuth 2.0 Identity and Access Management Patterns
- 振蕩指標MACD:波段操作精解(升級版)
- 下一場全球金融危機的到來:明斯基與金融不穩定
- PMP備考寶典:路晨帶你去通關
- 企業內部審計全流程指南
- Oracle Primavera Contract Management,Business Intelligence Publisher Edition v14
- Business Intelligence Cookbook:A Project Lifecycle Approach Using Oracle Technology
- 計量經濟學理論與應用:基于Eviews的應用分析
- Building Dashboards with Microsoft Dynamics GP 2016(Second Edition)