Solved

SSRS Highlight Dulpicates

Posted on 2010-08-31
3
1,275 Views
Last Modified: 2012-05-10
I need to show or highlight duplicate telephone numbers in my report.

I've tried doing i tin the sql script but the results are ot correct.
0
Comment
Question by:aneilg
[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
3 Comments
 
LVL 10

Accepted Solution

by:
itcouple earned 250 total points
ID: 33568418
Hi

Identifying them in your dataset might be the easiest option. IsDuplicate (true/false). What was the issue with your SQL?

You can usually do self-join for this kind of tasks. This works fine based on Microsoft Adventure works database... a lot of duplicated phone numbers in their db :)
SELECT     C1.CustomerKey, C1.Phone, CASE COUNT(C2.Phone) WHEN 1 THEN 0 ELSE 1 END AS IsDuplicated
FROM         DimCustomer AS C1 INNER JOIN
                      DimCustomer AS C2 ON C1.Phone = C2.Phone
GROUP BY C1.CustomerKey, C1.Phone

Let me know if that helps in your case

Regards
Emil
0
 
LVL 9

Assisted Solution

by:sureshbabukrish
sureshbabukrish earned 250 total points
ID: 33574942
if the dataset is sorted by telephone numbers in the report,you can use [previous] function in expression to determine whether the phone number is a duplicate of the previous one and then you can highlight it.

if it is not sorted, then you need to create a function which accepts the phone number as a parameter and tells you whether it is duplicated or not. you can use the function in your select query
0
 

Author Comment

by:aneilg
ID: 33580736
Thanks for your help guys.

I've had a look at both solutions and they are both good.

0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SSRS Access Remotely 5 81
Report Builder 3.0 for Sql Server 2014 1 107
Select single row of data for each ID in Select Statement 7 43
SSRS 2008 Spanish Translation 8 42
Time Corrections for Reports Working with a report, we made some interesting discoveries about the time corrections/updates We are using the following Parameters: Starting Entered Date (Date) formatted as Data type: "Date/Time" Ending Entered …
Have you ever had to extract data from a Microsoft SQL Server database and export it to an Excel file, but did not want to use a DTS package? The concept in this article is not new, but it is the answer and will also work on 64-bit SQL boxes.   …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

752 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