Hi,
I need to calculate YTD calculation on primary key- claim_id. I have learned how I can do this but in the case I need to start cumulating from 2nd record of particular S_ID. Not sure if this is possible. I really appreciate your time.
Using 10g and 11g
CLAIM_ID S_ID PAID SERVICE_DATE
123 S001 12 1-Jan-2010
124 S002 14 2-Jan-2010
125 S001 80 3-May-2010
126 S003 -86 4-Jul-2010
127 S001 54 1-Aug-2010
128 S001 45 2-Sep-2010
129 S002 87 3-Sep-2010
130 S001 89 4-Sep-2010
131 S003 55 1-Nov-2010
132 S004 56 2-Dec-2010
133 S003 52 3-Dec-2010
Desired Output:
CLAIM_ID S_ID YTD_PAID
123 S001 0
125 S001 12
127 S001 92
128 S001 146
130 S001 191
124 S002 0
129 S002 14
126 S003 0
131 S003 -86
133 S003 -31
132 S004 21