Solved

Display only duplicate records in Report Builder 3.0 Report

Posted on 2014-02-05
2
1,514 Views
Last Modified: 2014-02-07
I'm trying to create a report in Report Builder 3.0 that displays only those records that have duplicates for a field's value.  My data source is a model.  Some records are duplicated twice, some up to four times and then the rest are unique.  I want to hide or filter out the unique records and only display records if there is at least one other record in the dataset with the same value.  Any suggestions?  

Thank you,
0
Comment
Question by:jaisy99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 25

Accepted Solution

by:
chaau earned 500 total points
ID: 39837502
The way you do this is by using grouping with the having clause. Take for example this situation: you have a table with a few columns: Column1, Column2, Column3, Column4. If you are interested in checking for duplicates against Column2 and Column3 you would write a SQL Statement grouping by those two columns only, like this:
SELECT Column2, Column3
FROM Table1
GROUP BY Column2, Column3
HAVING COUNT(*) > 1

Open in new window

If you need to check all columns the SQL statement will look like this:
SELECT Column1, Column2, Column3, Column4
FROM Table1
GROUP BY Column1, Column2, Column3, Column4
HAVING COUNT(*) > 1

Open in new window

The important thing here is to have HAVING COUNT(*) > 1 clause. It allows to select only those records that have the duplications (more than one duplicate records)
0
 
LVL 1

Author Closing Comment

by:jaisy99
ID: 39843747
Thank you.
0

Featured Post

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, In my previous Article  (http://www.experts-exchange.com/Database/Reporting/A_15199-Introduction-to-Microstrategy.html)I discussed some basic understanding of Microstrategy that how we can get in Intro of Microstrategy (MSTR). Now it's tim…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

689 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question