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 Builder returns no value
GoranG
Hi all.
upon adding an aggregation builder with filter condition to my BIRT report, it happens that there is absolutely no value present. I'd like to have a 0.0 in such case. How to achieve this?
More info: I have three aggregation builders.
AB 1: Name = Difference, Data Type = Float, Function = SUM, Expression = dataSetRow["overallDifference"], no filter expression.
AB 2: Name = Negative Difference, Data Type = Float, Function = SUM, Expression = dataSetRow["overallDifference"], filter expression = dataSetRow["overallDifference"] < 0.0
AB 2: Name = Positive Difference, Data Type = Float, Function = SUM, Expression = dataSetRow["overallDifference"], filter expression = dataSetRow["overallDifference"] > 0.0
Experimenting (testing) this result with only row in "overallDifference" I get either positive difference printed out (some actual value), and no result in the negative difference field. Or vice versa. How can I "convince" the aggregation to return 0.0 even if everythign is filtered out?
Oh, maybe important: Format Number is set to ###,##0.00, and locale is set (to Swiss).
If this topic was already answered, please guide me to the correct topic. I tried searching but didn't find it.
Thanks,
G
Find more posts tagged with
Comments
mwilliams
Hi G,
If I'm understanding correctly, you could just put this in your onCreate script of your aggregation element:
if (this.getValue() == null){
this.setDisplayValue(0);
}
Hope this helps.
GoranG
Oh, yes, the misteries of scripts are revealed. The <br />
<pre class='_prettyXprint _lang-auto _linenums:0'>this.getValue()</pre>
and<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>this.setDisplayValue(0.0)</pre>
...<br />
it *is* simpler then I thought.<br />
<br />
Why didn't I think of it myself? (rhetoric question)<br />
<br />
Thank you, Mr. Williams.<br />
G<br />
<br />
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="69133" data-time="1286460584" data-date="07 October 2010 - 07:09 AM"><p>
Hi G,<br />
<br />
If I'm understanding correctly, you could just put this in your onCreate script of your aggregation element:<br />
<br />
if (this.getValue() == null){<br />
this.setDisplayValue(0);<br />
}<br />
<br />
Hope this helps.<br /></p></blockquote>
mwilliams
Ha ha! Not a problem! Let us know whenever you have questions!