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)
Bar chart with date x-axis that shows only previous 12 months
padytom
<p>I have a requirement for a report that has to at any point in time show the previous 12 months. Date has to be dynamic. Example data that should be showing on chart as of this month April should be previous 12 months ending march and when we get to may should include be 12 months ending with April.</p>
<p>Any help?</p>
Find more posts tagged with
Comments
padytom
<p>I have a requirement for a report with bar chart that uses date on the x axis. This date on x-axis should be dynamic and at any point should show previous 12 months. For example if report is run today, data that should be seen should be previous 12 months excluding this month April but when run next month, should include previous 12 months excluding may. Any Help? I think i need to create a computed column for the x-axis but short of ideas to compute this column.</p>
<p>Any help? </p>
JFreeman
<p>What version of BIRT are you using?</p>
<p>Can you attach a flat file with an example of your data?</p>
padytom
<p>4.2.3</p>
JFreeman
<p>Take a look at the attached sample report.</p>
<p> </p>
<p>I have created a table with a filter applied that filters between the current month minus 13 months and the current month minus one month. Then, I created a chart view of the table using the filtered data from the table as the data for the chart and set the chart view to be the default view.</p>
<p> </p>
<p>If you do not want the option of switching to the table view, you can instead build a separate chart using the table as the data source and then hide the table for all outputs.</p>
padytom
<p>Thanks a lot</p>
PascalH
<p>Hi there,</p>
<p>i had nearly the same Problem and i solved it by using a computed column resulting in an Integer based on</p>
<p> </p>
<p>BirtDateTime.diffDay(row["DATE"], BirtDateTime.firstDayofMonth(BirtDateTime.today())));</p>
<p> </p>
<p>So the result in the current month is always 0 and you could use it as a filter or Argument in a Statement.</p>