I have what is probably a simple question.
I'm working with credit card transaction data and each transaction has a fraud field that is populated with an 'N' or 'Y' depending on whether or not the transaction has been identified as fraud. Each record also has the account number.
I'm needing the number of accounts that have at least one transaction marked as 'Y' to get the total number of accounts that have had a fraudulent transactions.
I'm actually having to deal with this particular data in SAS as opposed to SQL server but it's a simple question and simple code so I figure you guys can assist.
I can write:
group by fraud_flag;
My questions pertains to how each distinct account number is assigned to a group in the group by. An account can have transactions with a fraud flag that is 'Y' and transactions with a fraud flag that is 'N'. Obviously distinct account numbers with all 'Y' transactions or all 'N' transactions would be counted in 'Y' or 'N' respectively. But what about accounts that have a mix of transactions. What determines if that distinct account is counted in the 'Y' or 'N' group?
Hopefully my question makes sense. If not, I'm happy to clarify further.
Thanks in advance for your assistance