赞
踩
- /*财务分析-总收入及净利润、毛利率及净利率
- 运营分析-销售情况、产品成本、库存周转
- */
- #1.1、收入及净利润
- create table a as
- select 年份, 总收入, 净利润 from data1;
-
- #1.2、毛利率及净利率
- create table b as
- select 年份,
- concat(cast(((总收入-商品成本)/总收入)*100 as decimal (4,2)),'%') as 毛利率,
- concat(cast((净利润/总收入)*100 as decimal (4,2)),'%') as 净利率
- from data1;
-
- #1.3、各产品利润率
- create table c as
- select 年份,
- concat(cast(((A产品收入-A商品成本)/A产品收入)*100 as decimal (4,2)),'%') as A产品利润率,
- concat(cast(((B产品收入-B商品成本)/B产品收入)*100 as decimal (4,2)),'%') as B产品利润率,
- concat(cast(((C产品收入-C商品成本)/C产品收入)*100 as decimal (4,2)),'%') as C产品利润率
- from data1;
-
- #2.1、销售情况
- #销售情况(单价与销量、收入、利润组合分析)
- create table dd as
- select
- 年份,
- A产品单价, B产品单价, C产品单价,
- A产品销量, B产品销量, C产品销量,
- A产品收入*10, B产品收入*10, C产品收入*10,
- cast((A产品收入-A商品成本)*10 as decimal(5,0)) as 'A产品利润*10',
- cast((B产品收入-B商品成本)*10 as decimal(5,0)) as 'B产品利润*10',
- cast((C产品收入-C商品成本)*10 as decimal(5,0)) as 'C产品利润*10'
- from data1;
-
- #2.2、产品成本
- #产品成本
- create table e as
- select 年份, 商品成本, 研发费用, 销售费用, 管理费用, 其他费用 from data1;
-
- #产品成本比例
- create table f as
- select 年份,
- concat(cast((商品成本/总成本)*100 as decimal (4,2)), '%') as 商品成本比例,
- concat(cast((研发费用/总成本)*100 as decimal (4,2)), '%') as 研发费用比例,
- concat(cast((销售费用/总成本)*100 as decimal (4,2)), '%') as 销售费用比例,
- concat(cast((管理费用/总成本)*100 as decimal (4,2)), '%') as 管理费用比例,
- concat(cast((其他费用/总成本)*100 as decimal (4,2)), '%') as 其他费用比例
- from data1;
-
- #收入与成本结合分析
- create table gg as
- select 年份,
- concat(cast((A商品成本/(A商品成本+B商品成本+C商品成本))*100 as decimal(4,2)),'%') as A商品成本占比,
- concat(cast((B商品成本/(A商品成本+B商品成本+C商品成本))*100 as decimal(4,2)),'%') as B商品成本占比,
- concat(cast((C商品成本/(A商品成本+B商品成本+C商品成本))*100 as decimal(4,2)),'%') as C商品成本占比,
- concat(cast((A产品收入/(A产品收入+B产品收入+C产品收入))*100 as decimal(4,2)),'%') as A产品收入占比,
- concat(cast((B产品收入/(A产品收入+B产品收入+C产品收入))*100 as decimal(4,2)),'%') as B产品收入占比,
- concat(cast((C产品收入/(A产品收入+B产品收入+C产品收入))*100 as decimal(4,2)),'%') as C产品收入占比
- from data1;
-
- #2.3、库存周转与应收
- create table h as
- select 年份, 存货周转天数, 应收账款周转天数 from data1;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。