Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 08 Sep 2003 @ 16:06:27 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: LEAD/LAG Analysis
 
From:   Swarnapuri, Vinod

The example given is helpful if we have to order by the same field as the output field. Is it possible to do if they are not the same.

For example :

Sales_man_id    month              Total Sales
----------------------------------------------
1               JAN-2003           $50,000
1               FEB-2003           $55,000
1               MAR-2003           $40,000
2               JAN-2003           $25,000
3               MAR-2003           $40,000

Supposing that the current month is Mar-2003 and we need sales_man_id, current_month, Total sale amount during the current month and total sale amount during the previous month.



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023