Archives of the TeradataForum
Message Posted: Tue, 08 Jan 2002 @ 16:41:31 GMT
I assume you run something like:
SEL RANK(SALES) as The_Rank , PRODUCT FROM TABLE QUALIFY THE_RANK<=10 ;
I think you want to change it to look like:
SEL AREA , RANK(SALES) , PRODUCT FROM TABLE GROUP BY 1 QUALIFY THE_RANK<=10 ;
Note that the group by clause is on Area so it will break by area. I find it easier to figure out what is going on when writing SQL using ;the OLAP functions to put everything you want to group by above the olap function and what you are olap'ing to be below the function. In this case you are ranking product grouping by area.
I hope that helps.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 27 Dec 2016|