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)
Line Chart with Running Total
kpelzer29
I am trying to create a line chart that displays a running total.
I found this DevShare article, which creates running sums using script in a text element of a crosstab:
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1255-birt-creating-your-own-running-sum-in-a-crosstab/
Is there a way to calculate a running total using a data cube? How would you recommend I calculate a running total and be able to use those values in a line chart?
Find more posts tagged with
Comments
mwilliams
Hi kpelzer29,
You should be able to use the aggregation "running sum" from the aggregation drop down under your y-series expression box on the "select data" tab of the chart editor.
kpelzer29
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="72937" data-time="1296774251" data-date="03 February 2011 - 04:04 PM"><p>
Hi kpelzer29,<br />
<br />
You should be able to use the aggregation "running sum" from the aggregation drop down under your y-series expression box on the "select data" tab of the chart editor.<br /></p></blockquote>
<br />
<br />
Hi mwilliams,<br />
<br />
I actually need to create a running sum by taking the current total, then adding and subtracting from that value to find the totals for previous months. I am accepting a data range as parameters for the report, so I do not know ahead of time what months I will need to display.<br />
<br />
For example:<br />
<br />
Total number of Classic Cars in inventory Feb-2011: 1000<br />
<br />
<strong class='bbc'>Jan-2011</strong> Total Cars Sold: 200 Total Cars Added to Inventory: 100 Total Cars in Inventory: 900<br />
<strong class='bbc'>Dec-2010</strong> Total Cars Sold: 150 Total Cars Added to Inventory: 200 Total Cars In Inventory: 950<br />
<strong class='bbc'>Nov-2010</strong> Total Cars Sold: 175 Total Cars Added to Inventory: 190 Total Cars in Inventory: 965<br />
<strong class='bbc'>Oct-2010</strong> Total Cars Sold: 100 Total Cars Added to Inventory: 80 Total Cars in Inventory: 945<br />
<br />
Total Cars in Inventory is the total number of cars in inventory at the end of the month. I am using the following formula to calculate the Total Cars in Inventory:<br />
<br />
Total cars in inventory for previous month - Total Cars Sold + Total Cars Added to Inventory = Total Cars in Inventory<br />
<br />
Total Cars in Inventory for Jan-2011: 1000 - 200 + 100 = 900<br />
Total Cars in Inventory for Dec-2010: 900 - 150 + 200 = 950<br />
and so on...<br />
<br />
Is there a way I can calculate and graph values such as the Total Cars in Inventory for each month? I also need to include columns similiar to Total Cars Sold and Total Cars in Inventory for each month. Thank you in advance for your help!
mwilliams
Using the running sum aggregation wouldn't require that you know what months you're using.
As for finding the total vehicles in inventory, you could use your formula in a computed column in your dataSet, then you'd have a field that would just tell you the number in inventory that you could use wherever you wanted.
If I'm misunderstanding something, let me know.
Sonika Narula Grover
<p>Hello.. In Birt report I have a table where for one field I need to calculate sum of top 10 values. Can you please help?</p>
Clement Wong
<p>This should be a new topic.</p>
<p> </p>
<p>If you have a field that you want to be a Top 10, you can first create a Computed Column in the Data Set that is a IsTopN aggregration, and in your case the N would be 10.</p>
<p> </p>
<p>Then, in your table, you can create a Aggregation Report Item to SUM on the field you want totaled, and then add a Filter with your Top10 Computed Column, where the Filter is true.</p>
<p> </p>
<p>Attached is a sample design tested on commercial iHub 3.1 and OS BIRT 4.5. There are 20 rows in the sample. The highlighted rows are in the Top 10 -- see Detail Row Highlight. The totals at the bottom of the table are for both the entire table and the Top 10.</p>