Comparing list to only show Names that have not turned in something

  • I have 2 Data Sets. One that shows The peoples names and when they have turned in there field logs. Then I have a data set that is just a list of names. How can i compare the two data sets to only show the names of the employees that have not turned in a field log.

     

    Edit: Ive tried using this but it does not work. It will bring up a name that has turned it in and will only bring up one name.

    =IIF(Format(First(Fields!FirstName.Value, "DataSet2") & " " & First(Fields!LastName.Value, "DataSet2")) = Format(First(Fields!FirstName.Value, "DataSet1") & " " & First(Fields!LastName.Value, "DataSet1")), Nothing, Format(First(Fields!FirstName.Value, "DataSet1") & " " & First(Fields!LastName.Value, "DataSet1")))

    • This topic was modified 4 years, 9 months ago by  nmoore.
  • This sounds like homework.  You're better off attempting this yourself.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • Yes I have for days. I don't think it is possible with report builder yet.

  • I'd suggest doing the set based work in your query rather than through expressions in the report.  I can think of 3 ways to do it offhand, though I'd like to see what query you come up with first.

  • Ill give it a try, But i really doubt i can get this Ive never need to compare using a first and last name to another first and last name. and they would have to be formatted together because a lot of people have the same name.

  • Also they have to be in two different data sets so it wont just give me the same name again. if you have any ideas where to start that would be great

  • I mean even if i could get it to a full list of names with when they submitted them but also have the names that havent submitted anything to show up. But i also need to keep the parameters to choose the dates i need.

  • Since we don't know what the 2 datasets look like it would be difficult for us to tell you where to start other than high level generic answers.  I'd start by looking at constructs such as:

    EXCEPT  https://docs.microsoft.com/en-us/sql/t-sql/language-elements/set-operators-except-and-intersect-transact-sql?view=sql-server-2017

    NOT IN  https://docs.microsoft.com/en-us/sql/t-sql/language-elements/in-transact-sql?view=sql-server-2017

    LEFT JOIN  https://www.sqlteam.com/articles/writing-outer-joins-in-t-sql

     

  • nmoore wrote:

    Also they have to be in two different data sets so it wont just give me the same name again. if you have any ideas where to start that would be great

    No, they don't.  That's what grouping is for.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • Okay. Im sorry i dont know much about the query. Still a newbie. What would you need to help me

     

  • You need to help you. Read the articles Chris posted. Create some tables, try out the different options - LEFT JOIN, EXCEPT, NOT IN.

  • Im doing that right now Thank you

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply