Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Getting values from other datasets/tables
smartinez7
<p><span>Hello,<br />
<br />
I need help with my report. I have three datasets/tables in my report. Each dataset has an amount that I would like to do get and and put into a fourth table with for a remaining balance. So I will show an example below.<br />
<br />
<br />
DataSet1/Table 1<br />
Vendor , Description, VendorID, <strong class='bbc'>Purchase Limit</strong><br />
<br />
DataSet2/Table 2<br />
Vendor, Description, VendorID, <strong class='bbc'>Spent Amount</strong><br />
<br />
DataSet3/Table<br />
Vendor, Description,VendorID, <strong class='bbc'>Invoice Amount</strong><br />
<br />
I want to have a 4th table or insert a data binding that has a remaining balance of<br />
<strong class='bbc'>Purchase Limit</strong> - <strong class='bbc'>Spent Amount</strong> - <strong class='bbc'>Invoice Amount</strong> = Remaining Balance for Vendor<br />
<br />
I don't know how to get attributes from different tables, can anyone help, please?<br />
<br />
I have attached my design file. Any help would be greatly appreciated. I'm using BIRT 3.7.1</span></p>
Find more posts tagged with
Comments
kclark
<p>In the initialize() you could create three ArrayList PGV's like this
</p><pre class="_prettyXprint _linenums:0">var array1 = new java.util.ArrayList();var array2 = new java.util.ArrayList();var array3 = new java.util.ArrayList();reportContext.setPersistentGlobalVariable("array1", array);reportContext.setPersistentGlobalVariable("array2", array);reportContext.setPersistentGlobalVariable("array3", array);</pre>
Then recall each of them in the onRender() of purchase limit, spent amount, and invoice amount.
<pre class="_prettyXprint _linenums:0">var purchaseLimit = reportContext.getPersistentGlobalVariable("array1");purchaseLimit.add(this.value());reportContext.setPersistentGlobalVariable("array1", purchaseLimit);</pre>
Then do the same for the other two and you should be able to call these back to preform some calculations with them later in your report.
smartinez7
<p><span>Kris,
The spent and invoice fields on those two tables are being summed in the SQL code. Will the array affect that or do I need an array at all? I should of been clear on my post on the purchase limit field. The Purchase Limit field is just a field I'm getting from the in the SQL code. The spent and invoice fields are sum functions in the SQL code. </span></p>
kclark
<p>Are these coming from the same database or three different databases?</p>
smartinez7
<p>Hey Kris,</p><p> </p><p>I was able to get my report to work. I used the global variable to configure my report and it worked.</p><p> </p><p>Thanks a lot.</p>