把上下半年的数据源表去掉合并单元格,然后引入外部查询,sql语句如下:
select 指标,项目,行次,"上半年" as 时间,"一公司" as 公司,一公司 as 值 from [上半年$a1:g27] union all
select 指标,项目,行次,"上半年","二公司",二公司 from [上半年$a1:g27] union all
select 指标,项目,行次,"上半年","三公司",三公司 from [上半年$a1:g27] union all
select 指标,项目,行次,"上半年","四公司",四公司 from [上半年$a1:g27] union all
select 指标,项目,行次,"下半年","一公司",一公司 from [下半年$a1:g27] union all
select 指标,项目,行次,"下半年","二公司",二公司 from [下半年$a1:g27] union all
select 指标,项目,行次,"下半年","三公司",三公司 from [下半年$a1:g27] union all
select 指标,项目,行次,"下半年","四公司",四公司 from [下半年$a1:g27]
[ 本帖最后由 抹香鲸2009 于 2010-7-19 22:36 编辑 ] |