Hello all
I need to be able to return a count of how many rows match on multiple variable values. For instance, with the following 3 variables: ID, varA, and varB...
sort varA
list ID varA varB
1. | 1 2 0 |
2. | 2 3 0 |
3. | 1 3 0 |
4. | 1 5 0 |
5. | 1 6 0 |
|-----------------------------|
6. | 1 7 0 |
7. | 1 8 0 |
8. | 2 8 0 |
9. | 1 10 0 |
10. | 2 11 0 |
I can see that 4 total rows (2 different IDs) where the match is the same on both varA and varB (bolded above for clarity). Any advice on a line of code to return this value instead of having to manually count it myself?
Thanks in advance.
I need to be able to return a count of how many rows match on multiple variable values. For instance, with the following 3 variables: ID, varA, and varB...
sort varA
list ID varA varB
1. | 1 2 0 |
2. | 2 3 0 |
3. | 1 3 0 |
4. | 1 5 0 |
5. | 1 6 0 |
|-----------------------------|
6. | 1 7 0 |
7. | 1 8 0 |
8. | 2 8 0 |
9. | 1 10 0 |
10. | 2 11 0 |
I can see that 4 total rows (2 different IDs) where the match is the same on both varA and varB (bolded above for clarity). Any advice on a line of code to return this value instead of having to manually count it myself?
Thanks in advance.
Comment