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)
Aggregating derived measures in birt 3.7
swampDev
Friends.....I've run into difficulty creating an aggregation from a derived measure in a cross-tab. When I try to access the derived measure in the 'Totals' column of the cross tab I receive the error explained below:
-- When I try with measure["..."], I recieve 'The measure name "(measure)" is not found.'
-- When I try with data["..."], I receive 'Computed measure is not acceptable for the aggregation binding "{0}". (Element ID:1)'
Please help! I'm so close!
Find more posts tagged with
Comments
JasonW
Where are you trying to access it? Can you give some more detail on what you are trying to do? BTW you can always use the same expression you used to create the derived measure.
Jason
JasonW
You could also use onCreate script to get the value and store in a global variable to use elsewhere.
Jason
swampDev
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="83768" data-time="1317827451" data-date="05 October 2011 - 08:10 AM"><p>
Where are you trying to access it? Can you give some more detail on what you are trying to do? BTW you can always use the same expression you used to create the derived measure.<br />
<br />
Jason<br /></p></blockquote>
<br />
Thanks for the reply! I'm trying to access the derived measure in the 'Grand Totals' aggregation column of a cross-tab. Here's some more detail.<br />
<br />
I have a cross tab like<br />
| Answers |Grand Totals<br />
_____________________________________________________________________________________<br />
| 1 |2 |3 |4 |5 |<br />
_________________|___________________________________________________________________<br />
Agent1 |question1| count(answer1)|count(answer2) |.....................|avg(answer4question1)<-(What I need) <br />
|
|
|
|
<br />
|question2| count(answer1)|count(answer2) |.....................| <br />
|
|
|
|
<br />
| ... | count(answer1)|count(answer2) |.....................| <br />
|
|
|
|
<br />
.<br />
.<br />
.<br />
<br />
so what I need to calculate for the grand total column is sum(count(answer_column_value)*answer_column_value)/count(question_answers)<br />
<br />
I've tried to do the calculation directly but I'll get either an InvalidNestException or a message indicating that a reference is out of scope.<br />
<br />
<br />
(Edit: wow, that did not format like the editor, I've attached a picture of the layout)
JasonW
Could you use something like the attached example?
It just does a running sum in script and uses the value-of tag to display the results. Note that it is reset to 0 for every new product line.
Jason
swampDev
Hey!! Thanks so much! I was able to use the javascript variables to keep up with the information I needed and display it in the totals column like I needed. I did, however, have to manually 'delete var' in the script of the totals text element (in other words, at the end of every row) so that the summations would not continually grow from row to row.
Also! Since some of the calculations involved dividing by zero...I ended up having to check if the value to be added was == 'Infinity', and if it wasn't, not add it to the summation (Again in other words, only add the aggregate the javascript summation variable if the value to be added != "Infinity")
Thanks again! You made my day.