Example SQL for Pie Chart - Teradata Ecosystem Manager

Teradata Ecosystem Manager User Guide

Product
Teradata Ecosystem Manager
Release Number
15.11
Published
May 2016
Language
English (United States)
Last Update
2018-05-03
dita:mapPath
nao1467305810726.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.