Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
Replacing null value with 0 in onCreate method
Migrateduser
I'm using some simple java to override the value of an aggregate 'SUM' in the onCreate method:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>//Code for sub-report totals
importPackage(Packages.java.lang);
var lastValue = this.getValue();
reportContext.setPersistentGlobalVariable("tot_workhours", new Float(lastValue));</pre>
<br />
But there are occasions where the field I'm aggregating on will not have any values (e.g. the mechanic didn't work last week), so the summation is null. I've tried different ways to add some testing on the value, but I'm just not getting it. <br />
<br />
Any ideas on how to replace a null value within the code above with a 0 value?
Find more posts tagged with
Comments
There are no comments yet