16.20 - 柱状图和线状图的示例 SQL - Teradata Ecosystem Manager

Teradata® Ecosystem Manager 用户指南

prodname
Teradata Ecosystem Manager
vrm_release
16.20
created_date
2018 年 10 月
category
用户指南
featnum
B035-3201-107K-CHS
下面是一个示例 SQL,可用来创建一个线状图,以显示两周内的作业持续时间。
SELECT StartDt, SUM(ProcDuration) TotalJobDuration
FROM
	(
		SELECT ev.ResourceId, ev.ResourceType, ev.TDPId, ev.UOWId, 
			   MAX(CASE WHEN EventType='START' THEN EventTS ELSE NULL END) StartTS, MAX(CASE WHEN EventType='END' THEN EventTS ELSE NULL END) EndTS,
			   (CASE WHEN StartTS IS NOT NULL AND EndTS IS NOT NULL AND EndTS>StartTS THEN (TimestampDiffSeconds(StartTS, EndTS ) ) ELSE NULL END) ProcDuration,
			   CAST(StartTS AS DATE) StartDt
		FROM MSMEvent ev 
		INNER JOIN MSMResource r
		ON r.ResourceId=ev.ResourceId
		GROUP BY 1,2,3,4
	)procd
WHERE StartDt IS NOT NULL
GROUP BY 1
报告查看器门户组件可显示以下线状图。