报表函数:
总计:
select 1
,t.month
,t.prd_type_id
,t.emp_id
,t.amount
/*,sum(t.amount) */
,sum(t.amount) over (partition by t.month) as prdValue
,sum(t.amount) over (partition by t.prd_type_id) as prdValue
from all_sales t
where t.year=2003
and month =1
and t.emp_id=21
========================================
1 1 1 1 21 10034.84 15139.36 10034.84
2 1 1 2 21 1034.84 15139.36 1034.84
3 1 1 5 21 15139.36
4 1 1 4 21 3034.84 15139.36 3034.84
5 1 1 3 21 1034.84 15139.36 1034.84
百分比:
select
t.year
,t.month
,t.prd_type_id
,t.emp_id
,t.amount
,ratio_to_report(t.amount) over(partition by t.month) as prd_type_ratio
from all_sales t
where t.year=2003
and t.month<=2
and t.prd_type_id in (1,2,3)
and t.emp_id=21
order by t.month,t.prd_type_id
======================================
1 2003 1 1 21 10034.84 0.82901593784801
2 2003 1 2 21 1034.84 0.0854920310759948
3 2003 1 3 21 1034.84 0.0854920310759948
4 2003 2 1 21 15144.65 0.812745016488721
5 2003 2 2 21 1544.65 0.0828943943715637
6 2003 2 3 21 1944.65 0.104360589139715
分享到:
相关推荐
EAS 扩展报表 函数 参考手册EAS 扩展报表 函数 参考手册
在用c#开发报表过程中,时常很多特殊的报表样式不知该如何实现,以及报表有哪些函数可以实现那些功能。那么,这个函数大全可以满足你的需要。
润乾报表函数总结,根据润乾报表教程总结的一些润乾常用函数。
金蝶报表函数公式说明
NULL 博文链接:https://diaoweili.iteye.com/blog/768305
水晶报表函数大全--数字函数篇.我觉得比较实用的东东。。大家可以看一下。。。
oracle分析函数,窗口函数,报表函数 分析函数(OVER) 分析函数2(Rank, Dense_rank, row_number) 分析函数3(Top/Bottom N、First/Last、NTile)
birt报表函数研究,所有常用函数的说明,及参数说明白
润乾报表函数文档,最全,最新的报表内部函数文档,包括数据集函数,时间函数,数学函数,字符串函数,并有详细的示例和说明
CR报表函数大全参考.pdf
金蝶报表函数取数公式,金蝶报表函数取数公式,金蝶报表函数取数公式
金蝶账务软件报表函数取数公式.doc
组态报表函数使用教程
金蝶账务软件报表函数取数公式.pdf
常见BIEE分析及报表函数使用详解 带了一些小例子,比官方的要清晰很多,适合各位BIEE初学者。 网上此类文档很少
(完整word版)金蝶账务软件报表函数取数公式.doc
润乾报表常用函数.pdf