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)
Suppress Duplicates
mdu_gprabh
Hi,
I have a requirement to suppress the duplicates in amt field based on unique combination of id and no field. I have attached the report design for your reference. I could not figure out the script to find the first record of the data to set a flag. I dont have a help document for writing script to proceed further. Please provide me the script in the attachment and also help me to find out a document to refer in writing the script for BIRT.
Input:
id no amt serial
101 1 1000 5
101 1 1000 10
101 1 1000 6
101 2 1000 5
101 2 1000 10
101 2 1000 5
101 3 500 5
101 3 500 10
101 3 5
output
id no amt serial
101 1 1000 5
101 1 10
101 1 6
101 2 1000 5
101 2 10
101 2 5
101 3 500 5
101 3 10
101 3 5
Thanks in Advance,
Prabu G
Find more posts tagged with
Comments
mwilliams
Hi Prabu G,
What version of BIRT are you using so I can open your report in the correct version?
mdu_gprabh
Hi Michael,
Thank you for your support. I am using BIRT Designer Version 2.2.2.
Thanks,
Prabu G
mwilliams
Prabu G,
Try this report design with your .csv file. You'll have to change the file location back in the dataSource as I changed it to my .csv file location.
I used 2 variables to keep track of the "last" id and no values. If one of them changes, I show the amt value again. If not, it outputs null. The variables are initialized in the initialize script of the report and the rest is done in the data element's expression.
mdu_gprabh
Hi Michael,
It is working fine. Thank you for your support.
Thanks,
Prabu G
bhagyaa
I have a requirement of the same Kind.But i want to supress duplicates for String values.The above given logic is working for Decimal fields and Integer fields.But not for string values.The varaible declared in intialize script using "var" is not able to store String values.
Can u Please Suggest how to implement this Also
Are there any special Key words to store String varaibles other than "var".
bhagyaa
Any updates on this Please
mwilliams
Hi bhagya,
Can you explain your requirement a little further? Thanks.