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)
Category report with trend on total
BRM
<p>I wonder if someone might be able to help me out here. I am trying to create a report that shows internet traffic by category with a trend line on the total amount. Here is a snippet of my data:</p>
<p> </p>
<div>Week Source Count</div>
<div>9/14/2014<span> </span>Facebook<span> </span>12</div>
<div>9/21/2014<span> </span>(not given)<span> </span>2</div>
<div>9/21/2014<span> </span>Facebook<span> </span>10</div>
<div>9/28/2014<span> </span>(not given)<span> </span>4</div>
<div>9/28/2014<span> </span>Facebook<span> </span>17</div>
<div>10/5/2014<span> </span>(not given)<span> </span>1</div>
<div>10/5/2014<span> </span>Facebook<span> </span>19</div>
<div>10/5/2014<span> </span>Other<span> </span>2</div>
<div>10/5/2014<span> </span>Web Form 1</div>
<div> </div>
<div>The categories are variable so I can't do a dataset with the categories as fields.</div>
<div> </div>
<div>I have attached a snippet of the chart that I have created from this data. I have the Source field set as the "Optional Y-series Grouping" for the chart. All of this is good so far.</div>
<div> </div>
<div>What I want to do is to have a trend line (4 week moving average) on the total amount of leads.</div>
<div> </div>
<div>I have a cross tab that presents the data more or less the way I want it. But I can't get that into chart form with the total amount of leads showing as the trend line.</div>
<div> </div>
<div>Thanks in advance for any help.</div>
<div> </div>
<div> </div>
Find more posts tagged with
Comments
Clement Wong
<p>Attached is a solution using commercial BIRT and HTML5 charts, created in version iHub 3.1. </p>
<p> </p>
<p>I used your sample data, and added a few more weeks since you wanted a 4 week moving average.</p>
<p> </p>
<p>The code is in the <em>afterRendering </em>event of the chart. We simply loop over the stacked totals via the stackedYData array, and build the moving average accordingly. Then insert a new series plotted as a line with that data.</p>
BRM
<p>Very cool. Thank you. This worked perfectly.</p>
<p> </p>
<p>One comment and one question:</p>
<p>In the elseif block when you are computing the values for the trend line as you get to the last values you need to divide those by 3.0, 2.0 and 1.0 respectively not 4.0 in each case as you have.</p>
<p> </p>
<p>Now the question, where would I find the documentation for the chart.getCore().addSeries() method. I want to play around with the properties of the added trend line (remove markers and that sort of thing)</p>
Clement Wong
<p>Thanks for catching that. I've updated the .rptdesign attachment.</p>
<p> </p>
<p>The HTML5 charts are HighCharts based so you can reference their APIs (well documented) @ <a data-ipb='nomediaparse' href='
http://api.highcharts.com/highcharts'>http://api.highcharts.com/highcharts</a>.</p>
;
<p> </p>
<p>Specifically, addSeries() is @ <a data-ipb='nomediaparse' href='
http://api.highcharts.com/highcharts#Chart.addSeries'>http://api.highcharts.com/highcharts#Chart.addSeries</a>.</p>
;
BRM
<p>Very helpful. Thanks again.</p>