Aggregate expression in CDS View

An aggregate expression calculates a single value from an operand operand by calling an aggregate function from multiple rows of a results set. They need Group By clause to aggregate values from multiple rows and  the non-aggregated fields  are specified in the GROUP BY clause.

Aggregate Functions:

Created a CDS view with below select with SUM function.


@AbapCatalog.sqlViewName: ‘ZFLIGHT_VW’
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: ‘Flight View with Aggregation Operation’
define view Zflight_View
as select from sflight
{
key sflight.carrid,
key sflight.connid,
sum( price ) as Total_Amount,
sflight.currency
} group by carrid, connid, currency

  


Data Preview:

CDS view with SUM & COUNT functions


@AbapCatalog.sqlViewName: ‘ZFLIGHT_VW’
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: ‘Flight View with Aggregation Operation’
define view Zflight_View
as select from sflight
{
key sflight.carrid,
key sflight.connid,
sum( price ) as Total_Amount,
sflight.currency,
count( *) as Lines
} group by carrid, connid, currency

  


Data Preview


SFLIGHT Table contents

最新文章

  1. springboot Serving Web Content with Spring MVC
  2. 微信公众平台自定义菜单及高级接口PHP SDK
  3. poj1160 post office
  4. 基于opencv的人脸检测的web应用
  5. Hadoop上路-02_Hadoop FS Shell
  6. Virtualbox - Fatal: Could not read from the boot medium; system halted!
  7. Linux下更新瑞芯微固件
  8. SpringMVC静态文件(图片)访问+js访问 简单小例子
  9. 与众不同 windows phone (10) - Push Notification(推送通知)之推送 Tile 通知, 推送自定义信息
  10. MonkeyRunner 实现自动点击截屏后与本地图库进行对比输出
  11. RestTemplate.getForObject返回List的时候处理方式
  12. APP测试常用工具以及框架
  13. FuzzScanner 信息收集小工具
  14. Python图像处理之图片文字识别(OCR)
  15. js异步编程终级解决方案 async/await
  16. mysql练习----Using Null
  17. [转帖]SSH 的 三种代理功能.
  18. UDP,TCP的套接字编程的Python实现
  19. Linux第二章读书笔记
  20. Python 数据类型:字典

热门文章

  1. spring-4.3.16+xfire-spring-1.2.6版本升级
  2. IOS MapKit框架的使用(专门用于地图显示)
  3. 战神CPU计算机硬件组装
  4. 2018.11.28 OGNL表达式与struts2框架结合的体现---在配置文件中体现(补充)
  5. c++ 单引号和双引号
  6. WebNotes(PHP、css、JavaScript等)
  7. 【洛谷P1367】蚂蚁
  8. 前端静态文件如何应对HTTPS的到来
  9. 买手机时几GB+几GB啥意思
  10. Oracle闪回恢复误删除的表、存储过程、包、函数...