Compare this year vs. previous year data in one graph (date vs. quantity)

Compare this year vs. previous year data in one graph (date vs. quantity)

Post by craigf » Thu, 27 Sep 2007 02:44:35


I want to create a graph (automatically in a report) which compares
the current year's values to the previous years by plotting two lines
on one chart.

I have one table which has the fields: Date and DeckDefects (which
is a number)

I would like the X axis to show months and the Y axis to show # of
DeckDefects


This should be real easy, but I can't find anything about it.

Thanks
 
 
 

Compare this year vs. previous year data in one graph (date vs. quantity)

Post by Allen Brow » Thu, 27 Sep 2007 23:32:11

Craig, I assume that this year's values and last year's values are all in
the one table (which is the right design.) Since you want 2 different
results for two different periods from the same table, use a subquery to get
last year's results and match them to this one.

If subqueries are new, see:
Subquery basics: Year to date
at:
http://www.yqcomputer.com/ #YTD
The article discusses what subqueries are, and demonstrates how to make a
year-to-date query. You can do a period-compared-to-last-year in the same
way.

Once you have the query, you can use it as the source for one of the chart
types that handles multiple domains.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://www.yqcomputer.com/
Reply to group, rather than allenbrowne at mvps dot org.