Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to compare different columns and supress the duplicates.
sureshk
How to compare the different columns and remove the duplicates in one column.
I have three columns. eg: My out put is like this.
col1| col2| col3| col4
12| 01| Jack| 12/3/08
12| 01| Jack| 11/4/08
12| 01| Jack| 10/3/08
13| 01| Jack| 11/5/08
14| 01| Tom| 09/2/08
14| 01| Tom| 01/2/08
I want the Output in the following format. I am comparing column 1 & column2 and according to that I have remove duplicates in column3, I want to replace Jack with blank space.
col1| col2| col3 Col4
12| 01| Jack| 12/3/08
12| 01| | 11/4/08
13| 01| | 10/3/08
13| 01| | 11/5/08
14| 01| Tom| 09/2/08
14| 01| | 01/2/08
Please tell me how to acheive in BIRT or with a Java script.
Find more posts tagged with
Comments
mwilliams
Hi sureshk,
The way you have your example displayed, you should be able to achieve this by highlighting the third column of your table and choosing "suppress duplicates" in the general section of the property editor. If you're hiding based off of column 1&2 like you stated, it'll be different to hide, but the way your example looks, suppress duplicates should work. It could have just been a typo in your example too. Let me know.
sureshk
Hi Michael
Sorry It was a typo error. It should be like this..
col1| col2| col3 Col4
12| 01| Jack| 12/3/08
12| 01| | 11/4/08
12| 01| | 10/3/08
13| 01| Jack| 11/5/08
14| 01| Tom| 09/2/08
14| 01| | 01/2/08
Please help me on this
thanks
suresh
mwilliams
Suresh,
You should be able to create a couple variables to track the last values in the initialize script of the report. Then, either in a computed column or in a data element/dynamic text element, you can use that variable to store the last values and use if/else statements to check if the values are the same as the current ones and either output the name or "" depending.
mwilliams
Suresh,<br />
<br />
Please see this <a class='bbc_url' href='
http://www.birt-exchange.com/forum/designing-birt-reports/13261-suppress-duplicates.html'>thread</a>
; to see an example of this. Use the .csv file from the .zip attachment and the .rptdesign file that I attached.