Set Aggregation value if null due to Filter Condition?
<p>I've got an aggregation (SUM) on a field that is set to aggregate on a group in BIRT 2.6.2. The problem is there are times when the aggregation may not find any fields to sum up, based on the Filter Condition.</p>
<pre class="_prettyXprint">
Column Binding: total_hours
Diplay Name: Total Hours
Data Type: Float
Function: SUM
Expression: dataSetRow["regularhrs"]
Filter Condition: dataSetRow["schedstart"] > row["date1"] && dataSetRow["schedstart"] < row["date2"]
Aggregate On: crewIDGrp (Group)</pre>
<p>I know the aggregation works because the summary will return values when there is data between the two date ranges. But when no records exist in the date range, the summary returns NULL instead of 0.00.</p>
<p> </p>
<p>Any suggestions on how to get the aggregate to return 0.00 in the event no data meets the Filter Condition?</p>
<pre class="_prettyXprint">
Column Binding: total_hours
Diplay Name: Total Hours
Data Type: Float
Function: SUM
Expression: dataSetRow["regularhrs"]
Filter Condition: dataSetRow["schedstart"] > row["date1"] && dataSetRow["schedstart"] < row["date2"]
Aggregate On: crewIDGrp (Group)</pre>
<p>I know the aggregation works because the summary will return values when there is data between the two date ranges. But when no records exist in the date range, the summary returns NULL instead of 0.00.</p>
<p> </p>
<p>Any suggestions on how to get the aggregate to return 0.00 in the event no data meets the Filter Condition?</p>
0
Comments
-
<p>Do you want to just display 0.00? If yes use mapping. Another option is to create another column binding and have the expression:</p>
<pre class="_prettyXprint">
if (row["total_hours"] == null) {
0;
}
else {
row["total_hours"];
}</pre>0
Categories
- All Categories
- 108 Developer Announcements
- 53 Articles
- 106 General Questions
- 144 IM Services
- 43 OpenText Hackathon
- 32 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 899 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 120 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management