집 >데이터 베이스 >MySQL 튜토리얼 >QlikView图表显示同比数据
数据准备如下: SalesData:LOADNum(ID) as ID,Date(Date) as Date,Month,Num(Year) as Year,Num(Sales) as SalesInline [ID, Date, Month, Year, Sales1, 2012-1-1, 1, 2012, 202, 2012-1-1, 2, 2012, 213, 2012-1-1, 3, 2012, 234, 2013-1-1, 1, 2013, 345,
数据准备如下:
SalesData: LOAD Num(ID) as ID, Date(Date) as Date, Month, Num(Year) as Year, Num(Sales) as Sales Inline [ ID, Date, Month, Year, Sales 1, 2012-1-1, 1, 2012, 20 2, 2012-1-1, 2, 2012, 21 3, 2012-1-1, 3, 2012, 23 4, 2013-1-1, 1, 2013, 34 5, 2013-2-1, 2, 2013, 35 6, 2013-3-1, 3, 2013, 46 7, 2014-1-1, 1, 2014, 27 8, 2014-2-1, 2, 2014, 30 9, 2014-3-1, 3, 2014, 49 ];
新建线形图表命名为Sales,如图所示,
将Month作为维度,如图所示:
在表达式那个tab中新建两个Expression 如下所示:
ActualSales的表达式如下:
=Sum({$< Year={'$(=Max(Year))'} >}Sales)
PCPSales的表达式如下:
=Sum({$< Year={'$(=Max(Year)-1)'} >}Sales)
点击确定,生成如下图表:
如有疑问,欢迎留言交流。
最近还会再写的几个Topic::
1. 显示所选时间前12个月销售数据;
2. 显示上一销售级别的销售;
3. 计算最近一年的销售数据。