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)
Unable to reference a running count column in a dataset
kevinshih
Hi all,<br />
<br />
I have a computed column added to a dataset. It is configured with the following properties:<br />
<p class='bbc_indent' style='margin-left: 40px;'><br />
Column Name: RECORD_COUNT<br />
Data Type: Integer<br />
Aggregation: RUNNINGCOUNT<br />
Expression: row["OID"}<br /></p>
<br />
In the onFetch() method of the dataset, I have the following javascript:<br />
<p class='bbc_indent' style='margin-left: 40px;'>reportContext.setGlobalVariable("ucUserCount", row.RECORD_COUNT);</p>
<br />
When I get the global variable later in the report, it is always null. If I change the onFetch() method to:<br />
<p class='bbc_indent' style='margin-left: 40px;'>reportContext.setGlobalVariable("ucUserCount", row.OID);</p>
then the global variable returns with a value when I call it.<br />
<br />
Am I referencing the computed column incorrectly?
Find more posts tagged with
Comments
Hans_vd
Hi Kevin,<br />
<br />
The reference is probably right, but the computed column is not computed yet in the onFetch method.<br />
<br />
I got this from BIRT documentation:<br />
<br />
<blockquote class='ipsBlockquote' ><p>onFetch:<br />
Called just after fetching each row before applying filters or calculating computed columns.</p></blockquote>
<br />
Is your dataset based on a database query?<br />
For most databases you can add what you need in the SELECT clause of the query.<br />
<br />
Hope this helps