Date: Wed, 9 Oct 2002 15:04:54 -0700
Reply-To: Student <psu02532@pdx.edu>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Student <psu02532@pdx.edu>
Subject: syntax question-- repeating calculations'
Content-Type: TEXT/PLAIN; charset=US-ASCII
I am stuck on a syntax problem, and hoped you could help. Clients
(client ID) received TX (TX Amount) at varying times (some episodes had 1
month, others more than 1 month). The EP_CT below delineates the episodes,
starting with the number 1 (i.e., episode 1 for client 161 consisted of
new# 1, 2, and 3; episode 2 had 4 months (1 to 4); and episode 3 had 3
months). What I want is a case for each client-episode that totals the
Tx_amounts from each of the months in that episode. I have attempted
looping and Lag counting, but have been unsuccessful-- perhaps there is an
easier way? Any help would be appreciated.
TX_ID Mo_Yr ClientID EP_CT Tx_Amount
103 11/1/1999 161 1 11
103 12/1/1999 161 2 31
103 1/1/2000 161 3 3
1220 2/1/2001 161 1 20
1220 3/1/2001 161 2 31
1220 4/1/2001 161 3 30
1220 5/1/2001 161 4 6
1220 9/1/2001 161 1 5
1220 10/1/2001 161 2 1
1220 11/1/2001 161 3 2
289 1/1/2001 164 1 0
289 2/1/2001 164 2 0
289 6/1/2001 164 1 0
289 10/1/2001 164 1 0
I want it to look something like this...
Client_ID Tx_Amnt Episode
161 45 1
161 87 2
161 8 3
164 0 1
etc....
|