什么是绝对值同比
本期数据-同期数据/|同期数据| 例:2019年1月1日的gmv -2018年1月1日的gmv/|2018年1月1日的gmv|
什么是绝对值环比
本期数据-上期数据/|上期数据|...例:2019年2月2日的gmv -2018年2月1日的gmv/|2018年2月1日的gmv|
数据集准备
建表语句
create table new_table(
dt string,
area string...,
province string,
saleroom int
);
数据准备:
insert into new_table values('2017-12-01', 'hd', 'sh','3600000...2018-12-04', 'hb', 'bj','2600000');
insert into new_table values('2018-12-05', 'hb', 'tj','1500000');
同比计算