Home
Analytics
Same timescale on X-axis for different charts
Bacalhau
<p>Hello,</p>
<p> </p>
<p>I'm struggling with an issue in a BIRT report. This is driving my crazy :wacko:</p>
<p> </p>
<p>Here's the scenario:</p>
<p>In order to create a report a user has to select a start Date and an end Date. Both are Report Parameters. Within that selected timeframe, the report should assess different kind of data (Incidents that occurred) and show them in different charts. The Y-axis represent the amount of incidents that occurred. The X-axis represent the dates of the incidents grouped by months for the selected timeframe. So far so good.</p>
<p> </p>
<p>Now, this chart shows the data of Incident A within the given time period (March to June):</p>
<p>
Find more posts tagged with
Comments
pricher
<p>Hi,</p>
<p> </p>
<p>Maybe this will help: <a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/topic/20273-bar-chart-using-a-date-field/'>http://developer.actuate.com/community/forum/index.php?/topic/20273-bar-chart-using-a-date-field/</a></p>
;
<p> </p>
<p>P.</p>
Bacalhau
<p>Thanks for your reply!</p>
<p> </p>
<p>The thing with this solution is, it only works fine if you really want a whole specific year to be shown. In my case, the chart should exactly display the data within the selected timeframe (can be less or more than a year) grouped by months...</p>
pricher
<p>Another way would be to work on the data side and ensure that each month is present in the data set used for the chart, even if there is no incident for that month. You can do this by having a file or a master database table where each row has the value for one date. If it's in a database, you can write your query to do a left outer join between the master date table and your incident table to get a result set where you will have at least one row per date in your date range. If you don't have or cannot create a master date table, you can store those dates in a file or an Excel spreadsheet and perform the left outer join in your BIRT report. I am sending you an example of the latter solution.</p>
<p> </p>
<p>Hope this helps,</p>
<p> </p>
<p>P.</p>
Bacalhau
<p>Hello,</p>
<p> </p>
<p>thank you for this good example. I think this could be a step in the right direction. Is there way to make the dates in the excel sheet independent from a specific year? Let's say, I have incidents from 2012 and I want to show last to months of 2012 and the first two months of 2013 in a chart, but the dates in the excel are only those of 2013. </p>
<p> </p>
<p>Best regards</p>
pricher
<p>Hi,</p>
<p> </p>
<p>Just add more dates to the spreadsheet to cover the spread of years. By the way, you need only one date per month in the master date table. In other words, the spreadsheet could just list 11/01/2012, 12/01/2012, 01/01/2013, etc and my example would still work. Also, I have used a spreadsheet because it is more portable as an example; in real-world application, I would create a master date table in a database and use the left-outer join at the SQL level.</p>
<p> </p>
<p>Hope this helps,</p>
<p> </p>
<p>P.</p>
Bacalhau
<p>Thanks, I will try this
</p>