Example SQL for Pie Chart - Teradata Ecosystem Manager

Teradata Ecosystem Manager User Guide

Product
Teradata Ecosystem Manager
Release Number
16.10
Published
June 2017
Language
English (United States)
Last Update
2018-03-29
dita:mapPath
zmg1488477755122.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-3201
lifecycle
previous
Product Category
Analytical Ecosystem
The following is example SQL to create a pie chart that displays a report showing the overall state of applications. To display a pie chart, the SQL must limit the result set to 20 rows or less.
SELECT st.StateName, COUNT(*) NumApplications
FROM
	( SELECT applicationId, Min(TRIM(COALESCE((CASE WHEN COALESCE(DaemonGroupAggStateCode,0) > COALESCE(DatabaseAggStateCode,0) THEN DaemonGroupAggStateCode ELSE DatabaseAggStateCode END),10)) ) AS stateCode FROM MSMApplication GROUP BY 1
) ast 
INNER JOIN 
	MSMState st ON st.StateCode=ast.StateCode
GROUP BY st.StateName
The Report Viewer portlet displays the following pie chart.