Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide duplicate row SSRS 2008 R2

Tags:

ssrs-2008

Duplicated data is coming in my report because source table has duplicate data. Without creating group, I want to hide duplicate data writing expression. So what I did: I select table row and put a expression for hidden property of table row.

The expression was like =(Previous(Fields!ID.Value) = Fields!ID.Value) but it did not work ... Still duplicate data is showing. So tell me how to suppress duplicate rows in ssrs writing expression not by grouping.

like image 629
Thomas Avatar asked Mar 16 '12 13:03

Thomas


People also ask

How to eliminate duplicate rows in SQL?

1) First identify the rows those satisfy the definition of duplicate and insert them into temp table, say #tableAll . 2) Select non-duplicate(single-rows) or distinct rows into temp table say #tableUnique. 3) Delete from source table joining #tableAll to delete the duplicates.

How to eliminate duplicate records from table?

To delete the duplicate rows from the table in SQL Server, you follow these steps: Find duplicate rows using GROUP BY clause or ROW_NUMBER() function. Use DELETE statement to remove the duplicate rows.


3 Answers

You probably should try these options first:

  • Try to clean the duplicate data at the source.
  • Change your source query so the duplicates don't appear in the dataset. (e.g. SELECT DISTINCT)

If not, on the row's Visibility Hidden property you can use the Previous function:

=iif(Fields!YourField.Value = Previous(Fields!YourField.Value), True, False)

You would have to sort on the YourField column for it to work.

like image 175
xm1994 Avatar answered Oct 16 '22 20:10

xm1994


I was putting the expression above also until I started using the "Hide Duplicates" line in the properties pane. You basically just select the row, in the dropdown choose your Dataset and that's it. any duplicates will be hidden. Also if you just want to hide certain textboxes duplicates you can do the same as i stated earlier except click on the textbox and not the row. Just another alternative, i'm aware you said using an expression.

like image 12
Rodney Maspoch Avatar answered Oct 16 '22 20:10

Rodney Maspoch


You can do it using expression or "Hide Duplicates" options from cell or row properties.

Expressions :

=IIF(Fields!YourField.Value = Previous(Fields!YourField.Value), True, False)

Hide Duplicates Steps:

  1. Select row or cell
  2. Click on F4 key on your Keyboard
  3. Look for "Hide Duplicates"
  4. Choose your DataSet from the dropdownlist

Done, I hope that helps

like image 7
user2120121 Avatar answered Oct 16 '22 21:10

user2120121