[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

[sqr-users] RANK function



Hello,
I'm in the process of writing a top 10 report. I want to take advantage of the 
DB2 function RANK
Here is the relevant code in the begin-select block:
begin-select...store.company_number &company_numbersku8.sku_6_digit &sku6_digit 
(,10)sum(fst.current_send_store_qty) &transfered_qty 
(,20)sum(fst.send_sku_retail_price_amt_lcy * fst.current_send_store_qty) 
&transfered_price rank() over (partition by 
store.company_number,sku8.sku_6_digit order by &transfered_price) &temp 
(,40)...end-select
I know that putting a SQR column variable is not correct but I want to rank by 
that metric. Also, just to test the rank function I have replaced the column 
variable with fst.send_sku_retail_price_amt_lcy but that did not work either.
Does any one know how to use the RANK function in SQR? please let me know what 
I'm doing wrong here.
 
Thank you
_________________________________________________________________
Fixing up the home? Live Search can help.
http://imagine-windowslive.com/search/kits/default.aspx?kit=improve&locale=en-US&source=wlmemailtaglinenov06

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users