Archives of the TeradataForum
Message Posted: Wed, 28 Apr 2004 @ 15:14:17 GMT
Consider your original data. The OLAP SUM function partitions by PARENT and sorts the data within each partition by AMT desc, CHILD desc. eg. your sorted data (with the computed OLAP SUM value for each row)
PARENT CHILD AMT OLAP_SUM X C NULL 1 X B NULL 2 X A NULL 3 Y G 40.00 1 Y F 25.00 2 Y H NULL 3
The OLAP_SUM column is the cumulative sum(1) over the sorted data within the partition, ie a running one-up counter of the sorted rows. The QUALIFY clause behaves like a HAVING clause in that it filters rows from the result set.
Hope that helps explain.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 23 Jun 2019|