Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Aggregation on Dynamic text
vivekpv10
I am new to birt reporting.I have added one "dynamic text" in my table.I want to get aggregate sum of this dynamic text field.How can i do this?
Find more posts tagged with
Comments
Hans_vd
You can not make a SUM of text.
And if your dynamic text contains only numeric data, then why is it a dynamic text item?
vivekpv10
I will attach that design file which using sample database.In that i want to get sum of "Total" Field
Hans_vd
Hi,<br />
<br />
I think the general setup of your report is rather strange.<br />
<br />
If you write your query like this, there is no more need for a dynamic text item and you can do whatever you want:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>select
CLASSICMODELS.CUSTOMERS.CUSTOMERNUMBER,
CLASSICMODELS.CUSTOMERS.CUSTOMERNAME,
SUM (CLASSICMODELS.ORDERDETAILS.QUANTITYORDERED) AS SUM_QUANTITYORDERED,
SUM (CLASSICMODELS.ORDERDETAILS.PRICEEACH) AS SUM_PRICEEACH
from
CLASSICMODELS.CUSTOMERS,
CLASSICMODELS.ORDERS,
CLASSICMODELS.ORDERDETAILS
where
CLASSICMODELS.ORDERDETAILS.ORDERNUMBER = CLASSICMODELS.ORDERS.ORDERNUMBER
and CLASSICMODELS.ORDERS.CUSTOMERNUMBER = CLASSICMODELS.CUSTOMERS.CUSTOMERNUMBER
GROUP BY
CLASSICMODELS.CUSTOMERS.CUSTOMERNUMBER,
CLASSICMODELS.CUSTOMERS.CUSTOMERNAME</pre>
vivekpv10
what i posted was a sample..i have a case similar to this.Two of the fields are generated from different dataset and i want to multiple these to fields and put it in a Dynamic text field called "Total".Dynamic text field have expression with report variables.So what is required is sum of this "Total" field.
Hans_vd
Can you create a joint data set to join the data from the different data sets?
vivekpv10
<blockquote class='ipsBlockquote' data-author="'Hans_vd'" data-cid="111735" data-time="1353502166" data-date="21 November 2012 - 05:49 AM"><p>
Can you create a joint data set to join the data from the different data sets?<br /></p></blockquote>..Other two dataset are formed from a stored procedure.Also it is not possible to join that datset.
Hans_vd
You could try this:
- create a third variable V3
- in the onCreate script where V2 is calculated, add a line of code to calculate V3:
vars["V3"] = vars["V3"] + (vars["V1"] * vars["V2"]);
- create a dynamic text field in the footer with this expression:
vars["V3"]
vivekpv10
@Hans_vd
..thanks..tested..it is working