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)
Like to build an Expression off another Expression's returned value
BIRTed T
I'm new to BIRT, originally got my start in CRYSTAL Reports, and I'm trying to bridge the gap.
I'd like to build an expression off an aggregation's value, but don't see how to do this in BIRT. In the expression builder, it only gives you 'available data sets' and computed columns to work with. I'm interested in using the values that are created by aggregations within the report, but don't see where those come into play. Being an old CRYSTAL user, I've been accustomed to writing in SQL, so JSP is a newly welcomed change... but this is also a small challenge.
In CRYSTAL, we'd just use the name of the aggregation plus '#' as a header in the formula... hoping it's something that simple in BIRT.
Thanks for any help!!
Trav
Find more posts tagged with
Comments
mwilliams
Hi Trav,
If you create an aggregation within a table, you can use this aggregation within that table. Where are you trying to access the aggregation field?
BIRTed T
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="70974" data-time="1291320609" data-date="02 December 2010 - 01:10 PM"><p>
Hi Trav,<br />
<br />
If you create an aggregation within a table, you can use this aggregation within that table. Where are you trying to access the aggregation field?<br /></p></blockquote>
<br />
I was trying to come up with a percentage, dividing two field's aggregation totals. After messing around with things and found out you could insert a 'Data' figure (which is column binding), which allows you to use the aggregations from other calculations.<br />
<br />
Now I have a new issue... I'm trying to have NULL values return as 0 (zero), but not having much success. I've tried:<br />
<br />
if (row["Aggregation"] == 0 || row["Aggregation"] == null)<br />
0;<br />
else<br />
(row[""Aggregation_9""]/row["Aggregation"]);<br />
<br />
but it doesn't return a 0 (zero) for the value when it is NULL... can you shed some light?!<br />
<br />
Thanks Michael<br />
Trav
BIRTed T
Nevermind... friend of mine found the 'Script' section where
if (this.getValue() == null) {
this.setDisplayValue(0);
}
works on 'onRender', which returns a zero value when NULL.
Thanks again
mwilliams
So, is everything working as expected now? If so, let us know whenever you have questions.
BIRTed T
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="71126" data-time="1291748253" data-date="07 December 2010 - 11:57 AM"><p>
So, is everything working as expected now? If so, let us know whenever you have questions.<br /></p></blockquote>
<br />
Yes... everything is working now... thanks for the response.<br />
<br />
I do have another question though, but since you're checking this thread I won't start a new discussion. <br />
<br />
I have been working with Crystal Reports up until recently and have become accustom to the free-form placement of lines and such (which I used to show separation of column headers). I haven't found a solution within BIRT for this. I've added another grid above my table, and added lines and brackets within this grid to show separation, but it won't repeat on every page (because it's not a header). I can't add another header to the table, because it defaults to the original column placement (ie I have 14 columns, but only need three columns to show separation). Ultimately what I'd like to do seen below.<br />
<br />
<br />
Column1 Column2 Column3 Column4 Column5 Column6 Column7 Column8 Column9 Column10 Column11 column12 etc.<br />
<br />
Let me know your thoughts<br />
<br />
Thanks Michael<br />
Trav
mwilliams
Trav,
Couldn't you just add another header line and then merge the first 3 columns and put your separation markings in this large, merged column? Let me know if I'm not understanding the issue correctly!
BIRTed T
worked out great... thanks for the tip man
mwilliams
Not a problem. Glad to help!