Below is the dataset and I have to pick customer_id who have submitted ADDRESS and ID proof but not submitted INCOME proof. How can I choose those obs? For example, Custome_id 3 is the only one who have not submitted income proof.
Thanks.
customer_id proof
1 income
1 id
1 id
2 address
2 income
2 id
3 address
3 address
3 id
proc sql;
create table want as
select distinct ID
from have
where id not in (select distinct ID from have where proof = 'income');
quit;
You can use SQL for this nicely.
Remember that text comparisons are case sensitive.
@meetagupta wrote:
Below is the dataset and I have to pick customer_id who have submitted ADDRESS and ID proof but not submitted INCOME proof. How can I choose those obs? For example, Custome_id 3 is the only one who have not submitted income proof.
Thanks.
customer_id proof
1 income
1 id
1 id
2 address
2 income
2 id
3 address
3 address
3 id
proc sql;
create table want as
select distinct ID
from have
where id not in (select distinct ID from have where proof = 'income');
quit;
You can use SQL for this nicely.
Remember that text comparisons are case sensitive.
@meetagupta wrote:
Below is the dataset and I have to pick customer_id who have submitted ADDRESS and ID proof but not submitted INCOME proof. How can I choose those obs? For example, Custome_id 3 is the only one who have not submitted income proof.
Thanks.
customer_id proof
1 income
1 id
1 id
2 address
2 income
2 id
3 address
3 address
3 id
Thank you very much. it worked.
CustomerID 1 doesn't seem to have submitted ADDRESS proof either?
So 1 shouldn't qualify right?
I only wanted customers who have not submitted Income proof. thanks
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.