通过写数据集来完成组合图同比

帮助文档上面写的是用公式计算今年某月同比去年对应月份的数据,但是如果我想要参数控件筛选的时间段的同比呢?


FineReport 百煮味香 发布于 2022-5-9 18:07 (编辑于 2022-5-9 18:07)
1min目标场景问卷 立即参与
回答问题
悬赏:3 F币 + 添加悬赏
提示:增加悬赏、完善问题、追问等操作,可使您的问题被置顶,并向所有关注者发送通知
共1回答
最佳回答
0
qianyipdcLv2见习互助
发布于2022-5-10 10:33

with t1 as

(select sum(amount) amount from dual

where fdate between '${start_date }' and '${end_date}'),

t2 as 

(select sum(amount) amount_last_year from dual

where fdate between  to_date('${start_date }', 'yyyyMM') + interval '-1 year' and to_date('${end_date}', 'yyyyMM') + interval '-1 year')

select (amount-amount_last_year)/amount_last_year 同比 from t1

left t2 on 1=1

  • 1关注人数
  • 283浏览人数
  • 最后回答于:2022-5-10 10:33
    请选择关闭问题的原因
    确定 取消
    返回顶部