Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have two fields, Email and ExamCode.
I need to find the Emails that have duplicate ExamCodes
For example:
ExamCode | |
email1@test.com | 110C |
email1@test.com | 116C |
email1@test.com | 116C |
email1@test.com | 116C |
email1@test.com | 110C |
email1@test.com | 316C |
email2@test.com | 110C |
email2@test.com | 117C |
email2@test.com | 118C |
email2@test.com | 316C |
email3@test.com | 116C |
email3@test.com | 117C |
email3@test.com | 119C |
email3@test.com | 316C |
email3@test.com | 316C |
email4@test.com | 110C |
I would need something where the results would be something like this:
Emails | Duplicate ExamCodes | Count |
email1@test.com | 116C | 3 |
email1@test.com | 110C | 2 |
email3@test.com | 316C | 2 |
It excludes email2 and 4 because they don't have duplicates.
I tried something like this:
Count(TOTAL<Email> ExamCode) >= 2
I also tried to use a substingcount like the one below:
SubStringCount(Concat ( TOTAL <Email> SubField(Email, ' ',1)&SubField(ExamCode, ' ',1)&' '), SubField(Email, ' ',1)&SubField(ExamCode, ' ',1)&' ') >= 2
But they end up including ones that just have single ExamCodes. I am not sure what I am doing wrong.
Hi,
It should be quite straightforward.
Build a table with Email and Exam Code as dimensions and this expression:
if(count(Email)>1,Count(Email))
But that only gives me email counts. not examcode counts.
Try this. I am counting "1" to just get number of records. You could use a key of that table if you want to count different but this should suffice:
If(Count(Total <Email, ExamCode> 1) > 1, Count(Total <Email, ExamCode> 1))
If(Count(Total <Email, ExamCode> 1) > 1, Count(Total <Email, ExamCode> 1))
This seems to be counting all ExamCode per email where emails have more than one ExamCode.
But it needs to find only emails that have duplicate ExamCodes not just more than one unique ExamCodes.
If Email & ExamCode are your dimensions (which is what your screenshot had), and that is your expression, it is counting the number of records for each Email + ExamCode ("Total <Email, ExamCode> ").