3 Replies Latest reply on Oct 12, 2017 7:56 AM by Jim Dehner

    Filtering Records with Two Primary Keys

    Alexander Schraut

      I have been lurking on this page for more than two years, and I have to say the help on this site is AMAZING! I really hope someone can help me out with this problem...And I hope I'm putting this request in the right place...


      I have a large SQL DB that is updated daily from some internal systems and scripts I have running. One of my tables includes records for investigations, and it has two primary keys (Case ID and Owner). For each individual Case ID (unique number auto-assigned to each case), I will have multiple rows based on how many people have interacted with the case (owners). All other columns are the same for these rows except the owner. The problem I have is this...I have two distinct teams that work on these cases. I have grouped them and am now trying to filter all the Case IDs to show only those cases that only have someone from 1 team associated with the case. Ex. Bob, Susan, and Frank are with Team A, and John, Eddy, and Mark are with Team B. Case 1234567 is "owned" by Bob and Frank, but no one from Team B. I need to show this Case ID. Case 7654321 is owned by Susan, Frank, John, and Mark. I do not want to show this case since people from Team A and B "own" the case.


      I hope this makes sense. I have attached a mock up data set and worksheet to demonstrate what I am looking at. The end result I am looking for is what is shown on Sheet 1 except with all the cases that are owned by both teams removed. I am currently use version 10.1.5.


      Thank you in advance for your help!