Hello everybody!
I got a SPSS file with the variables "user-id" "date" and than certain information about his consumer behaviour and payments for this particular month.
I now want to calculate -for example- the overall amount spent by every customer.
The user-ids are not consecutive.
So I need sth like
if "user-id" of case2 equals "user-id" of case1 then "new variable" (for case2)= "payment" of case1 + "payment" of case2
if "user-id" of case3 equals "user-id" of case2 then "new variable" (for case3)= "new variable" of case2 + "payment" of case3
and so on...
and then i need to get the last value if "user-id" of case(x) does not equal "user-id" of case(x+1)
best way to get this value is to have a second new variable with only the highest value for the same user-id!
I also want to calculate how long the customer stayed with the company and if he defected (last date does not equal a fixed "maximum date") or not (last date is this fixed "maximum date")
I hope u understand my problem and the dilemma i have solving it... in java i could imagine programming sth like that with some fors and ifs or whiles
but in SPSS!????
Thanks a lot for your help!
Greetings
Linschn
I got a SPSS file with the variables "user-id" "date" and than certain information about his consumer behaviour and payments for this particular month.
I now want to calculate -for example- the overall amount spent by every customer.
The user-ids are not consecutive.
So I need sth like
if "user-id" of case2 equals "user-id" of case1 then "new variable" (for case2)= "payment" of case1 + "payment" of case2
if "user-id" of case3 equals "user-id" of case2 then "new variable" (for case3)= "new variable" of case2 + "payment" of case3
and so on...
and then i need to get the last value if "user-id" of case(x) does not equal "user-id" of case(x+1)
best way to get this value is to have a second new variable with only the highest value for the same user-id!
I also want to calculate how long the customer stayed with the company and if he defected (last date does not equal a fixed "maximum date") or not (last date is this fixed "maximum date")
I hope u understand my problem and the dilemma i have solving it... in java i could imagine programming sth like that with some fors and ifs or whiles
but in SPSS!????
Thanks a lot for your help!
Greetings
Linschn