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 record column data with previous record column data
USHA
Hi
How to Compare present record column data with previous record column data?
If present record column data is same as the previous column data i have to display only the amount column data in the previous record only and it should display blank in the present record.
Check the below example
Input:
Col1 Amount
123 50 (Previous record)
123 50 (Present Record)
245 100
245 100
output should be:
Col1 Amount
123 50
123
245 100
245
I am using BIRT 3.2.15
Thanks in Advance
Usha
Find more posts tagged with
Comments
Davolio
<a class='bbc_url' href='
http://www.birt-exchange.com/forum/designing-birt-reports/12472-table-filtered-data.html?=newpost&t=12472'>http://www.birt-exchange.com/forum/designing-birt-reports/12472-table-filtered-data.html?=newpost&t=12472</a><br
/>
<br />
I think is similar to what you're doing. I created a text box and a global variable to save the previous record value then compared it to the current one.<br />
<br />
Run this script onCreate for each Cell.<br />
<br />
this.text = this.getRowData().getColumnValue("comlumIwantToSave");<br />
if(this.text.equals(reportContext.getGlobalVariable("previousVal")))<br />
{<br />
this.text = "";<br />
}<br />
else<br />
{<br />
reportContext.setGlobalVariable("previousVal",this.text);<br />
}<br />
<br />
Hope that helps,<br />
<br />
Dave
mwilliams
Hi Usha,
You could also highlight the column in the table and go to the general section in the property editor and select the "suppress duplicates" checkbox.
Hope this helps.
USHA
Thanks Michale its a simple way
It really works...
Thanks
Usha.
mwilliams
No problem! Let us know if you have any other questions.
kevin23_hy
<blockquote class='ipsBlockquote' data-author="USHA"><p>
<br />
I am using BIRT 3.2.15<br />
<br />
Thanks in Advance<br />
Usha</p></blockquote>
<br />
<br />
Birt 3.2.15? now latest version is not 2.32? do you using the acuate product?
mwilliams
Kevin,
3.2.15 is actually just the xml version of the model. You'll see this in the XML Source file. The BIRT version Usha is using is probably 2.2.2 or 2.2.1. BIRT 2.3.0 is with version 3.2.16, BIRT 2.3.1 is with version 3.2.17, and so on.
The Eclipse versions are 3.3.x for Europa and 3.4.x for Ganymede.
USHA
Thanks for the explanation williams
i have posted the below thread in the forum but i have not get any reply for it. Could you plz look into this....
Hi.. I have the requirement like
if tab1.col1='a' then join the tab1 and tab2 tables as
tab1.col2=tab2.col2
else if tab1.col1='b'
tab1.col3=tab2.col3
I am using Actuate Information Object(database is DB2) to create the view.
I am thinking the below one would work but i dont know this is correct or not
"FROM tab1 JOIN tab2 ON ((tab1.col1='a' AND tab1.col2=tab2.col2)
OR (tab1.col1='b' AND tab1.col3=tab2.col3))"
Is this code could fulfill my requirement... Provide the correct solution if i am wrong
Thanks in Advance
Usha
mwilliams
Usha,<br />
<br />
I responded to your latest question in here in <a class='bbc_url' href='
http://www.birt-exchange.com/forum/designing-birt-reports/13151-need-help-information-object-db2-database.html#post40876'>your
original post</a>.
USHA
Thank You Michel
USHA
Sorry, My requirement is little bit changed. <br />
<br />
I have three columns. eg: My out put is like this.<br />
<br />
<strong class='bbc'>col1| col2| col3| col4 </strong><br />
12| 01| Jack| 12/3/08<br />
12| 01| Jack| 11/4/08<br />
12| 01| Jack| 10/3/08<br />
13| 01| Jack| 11/5/08<br />
14| 01| Tom| 09/2/08<br />
14| 01| Tom| 01/2/08<br />
<br />
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. <br />
<br />
<strong class='bbc'>col1| col2| col3 Col4 </strong><br />
12| 01| Jack| 12/3/08<br />
12| 01| | 11/4/08<br />
13| 01| | 10/3/08<br />
13| 01| | 11/5/08<br />
14| 01| Tom| 09/2/08<br />
14| 01| | 01/2/08<br />
<br />
Please tell me how to acheive in BIRT or with a Java script.
mwilliams
Usha,
To get what you posted in your last message, you'd just need to highlight the third column and select the supress duplicates column in the property editor. If you're hiding column 3 based off of column 1 & 2, it'd be different, but in your example, you still hide "Jack" when column 1 goes from '12' to '13'. Was this just a typo?