Discussion:
SPSS Select Cases help...please
(too old to reply)
d***@gmail.com
2020-04-30 18:25:55 UTC
Permalink
I have a database with about 900,000 rows that represent a person using a state service. One person can have many rows, a new one is generated each time they start a new service.

I need to select only those cases where the person is not using ANY services at this time and can't figure how to do it.

I need the program to look at all rows that have the same ID number (each person is always entered using the same ID number, no matter the service), then determine if all of a person's services (if multiple rows) are Inactive (there is a variable for that - can be inactive or pending or active). If all rows for the same person are inactive, those are the cases I want to keep.

Obviously if I were to Select Cases for "IN", I will get a list of inactive services, but the person associated could have had other services that are still active that got cut.

Guidance please...and thank you!
Rich Ulrich
2020-05-01 01:40:48 UTC
Permalink
Post by d***@gmail.com
I have a database with about 900,000 rows that represent a person using a state service. One person can have many rows, a new one is generated each time they start a new service.
I need to select only those cases where the person is not using ANY services at this time and can't figure how to do it.
I need the program to look at all rows that have the same ID number (each person is always entered using the same ID number, no matter the service), then determine if all of a person's services (if multiple rows) are Inactive (there is a variable for that - can be inactive or pending or active). If all rows for the same person are inactive, those are the cases I want to keep.
Obviously if I were to Select Cases for "IN", I will get a list of inactive services, but the person associated could have had other services that are still active that got cut.
Guidance please...and thank you!
One way -
Make a new variable where InactiveYN = 1 for Yes, 0 for other.

Do an Aggregate to get the Mean(InactiveYN) which you
(use the option to) save as a new variable to each record.

Select the cases where that mean is 1.0.
--
Rich Ulrich
d***@gmail.com
2020-05-01 02:48:54 UTC
Permalink
Ah ha! That makes sense...I will try tomorrow. I recognize your name from reading through other questions to search for an answer...thank you very much for sharing your knowledge to help others.

I will let you know.
Diana

Loading...