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)
Aggregation Using Report Variables
sriram nagappan
<p>Hi,</p>
<p> </p>
<p>I have two columns whose values are populated from Scripted dataset. I need to show the difference of two values in the third column. I tried report variable for storing the column 1 value to 1st variable (On Create Event) and column 2 value to 2nd variable (On Create Event) and displaying the difference of variable 2 & variable 1. But the difference value is showing in the next row and not in the same row. Can you please help.</p>
Find more posts tagged with
Comments
PaulCooper
<p>Add Data Item (and hence a binding) to the table that calculates the difference between the two other fields. Put that in the third column.</p>
sriram nagappan
<p>Hi,</p>
<p> </p>
<p>Here both my columns are indivually binded with Scripted Dataset. I need the difference of two columns in the third column</p>
PaulCooper
<p>When you say column are you talking about a table or in the Dataset?</p>
sriram nagappan
<p>Hi,</p>
<p> </p>
<p>It's a table.</p>
<p>I have two columns in table which are separately binded to scripted dataset.</p>
PaulCooper
<p>Add a data item from the palette to the third column. This will bring up a "New Data Binding" dialog. Rename the Binding to something that makes sense, set the data type to the appropriate value, then add an expression to it. This expression will be of the form:</p>
<pre class="_prettyXprint">
dataSetRow["Field2"]-dataSetRow["Field1"]
</pre>
<p>Change the "Field1" and "Field2" to the appropriate names for the fields you wish to find the difference of.</p>
<p> </p>
<p>Click ok and the new Data Item should contain the value you need.</p>
<p> </p>
<p>Paul</p>
sriram nagappan
<p>Hi,</p>
<p> </p>
<p>My table is binded to one db dataset. In that, two specific columns are individually biinded to another scripted dataset.</p>
<p>I need to take the values from these two columns and do a difference and shown it in the third column.</p>
<p>So i will not be able to use <span>dataSetRow</span><span>[</span><span>"Field2"</span><span>]-</span><span>dataSetRow</span><span>[</span><span>"Field1"</span><span>] since those two fields/columns are from different dataset.</span></p>
PaulCooper
<p>Ah now it is clearer you didn't say they were from different data sets before. Try an expression using the Column Bindings for Field1 and Field2 instead:</p>
<pre class="_prettyXprint">
row["Field2"]-row["Field1"];
</pre>
<p>Regards,</p>
<p> </p>
<p>Paul</p>
sriram nagappan
<p>Hi,</p>
<p> </p>
<p>I am using two report variables to store Existing Limits & Proposed Limits column in the attached report screenshot.</p>
<p>But i am getting the difference in the next row instead in the same row, </p>
<p>Please see the attached report output.</p>
PaulCooper
<p>At this point I would say we need to see your rptdeisgn file to get a better idea of what is going on.</p>
sriram nagappan
<p>Hi,</p>
<p> </p>
<p>Please find the rptdesign file attached.</p>
sriram nagappan
<p>Hi,</p>
<p> </p>
<p>are you able to crack it.</p>
PaulCooper
<p>I have taken a look and what you have is rather complicated. It is going to take me time to understand and try and reproduce the effect using something like the Classic Models database or more likely using pure random generated scripted data sets. If you have some sample data for all the datasets which I could use to modify the data sets to output and then test with I would be grateful.</p>
<p> </p>
<p>In the meantime have you considered instead of binding multiple datasets to the table and to elements in that table, to use Joint Data Set feature to link two data sets into a third?</p>
<p> </p>
<p>Paul</p>