Learning SAS? Welcome to the exclusive online community for all SAS learners.

Find the Customer(s) who has performed only one transaction

Accepted Solution Solved
Reply
Contributor
Posts: 65
Accepted Solution

Find the Customer(s) who has performed only one transaction

Objective: Find the Customer(s) who has performed only one transaction.

Data TFile;
input CustID Transaction_Amt Date: $10.;
datalines;
001 1200 10/06/2008 
001 1300 11/03/2009
002 1400 11/07/2009
001 3400 01/06/2007
003 1200 01/06/2010
003 1300 03/08/2012
002 2300 05/10/2011 
004 4300 05/10/2012 
005 3300 05/10/2014
;
Regards,
AG_Stats

Accepted Solutions
Solution
‎03-15-2016 08:12 AM
Super User
Super User
Posts: 7,992

Re: Find the Customer(s) who has performed only one transaction

Hi,

proc sql;
  create table WANT as
  select * 
  from   TFILE
  group by custid
  having count(custid)=1;
quit;

View solution in original post


All Replies
Solution
‎03-15-2016 08:12 AM
Super User
Super User
Posts: 7,992

Re: Find the Customer(s) who has performed only one transaction

Hi,

proc sql;
  create table WANT as
  select * 
  from   TFILE
  group by custid
  having count(custid)=1;
quit;
Contributor
Posts: 65

Re: Find the Customer(s) who has performed only one transaction

Thanks,

 

Ankit Gulati

Regards,
AG_Stats
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 353 views
  • 1 like
  • 2 in conversation