O'Reilly logo

Practical Predictive Analytics by Ralph Winters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Identifying members with multiple purchases

Try this query on your own in a new script to determine which members had multiple purchases. There should be 89 of them. In SQL query parlance, the multiple purchases clause is indicated in the query by count(*) > 1:

dups <- sqldf("select member.memberid,count(*) from  member left outer join  purchases_filtered on  member.memberid=purchases_filtered.memberid2  group by member.memberid having count(*) > 1")

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required