|
Archives of the TeradataForumMessage Posted: Wed, 28 Oct 2009 @ 19:17:35 GMT
Hi Everyone, First let me thank everyone for their replies to my previous question. The answers were very helpful. I am currently trying to summarize data for a report and data pull that is looking for the following columns: Yr-Month Units Added Cumulative(Units Added) Monthly Runtime Cumulative(Monthly Runtime) The issue seems to be with nested aggregates. My current query gets me up to the last column - Select t.Yr-Month, t.UnitsAdded, CSUM(t.UnitsAdded, t.Yr-Month) as ActiveUnits, (ActiveUnits * 30 * 24) as MonthlyRuntime From ( Select cast((COMMISSION_DATE (format 'yyyy-mm') ) as char(16)) as Yr-Month ,count (COMMISSION_DATE) as UnitsAdded From tableX Group By Yr-Month ) t Order By t.Yr-Month Ideally I would like to do a CSUM (Monthly Runtime) but I get the nested aggregate error. I would appreciate any suggestions Regards, Fred Graham
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||