473,396 Members | 2,037 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Comparing quarterly sales data to previous quarter and previous year.

I have created a query that examines qarterly sales for 5 regions in
the country. The query contains data for the past 6 quarters for each
region and calculates the perecentage of total sales for the quarter
fo each region.

To help enhance the report I would love to include a comparison to of
current sales to previous quarter sales and a comparison of current
sales to sales a year ago. I am having a devil of a time creating a
query to perform those actions. I am not skilled at VBA and was
hoping someone could provide me with the code that will make the
comparisons.

Below is the all of the data in my query.

Your help would be greatly appreciated!!

Quarter Region SumOfSALES SumOfSumOfSALES Percentage
2003 1Q Central 199309.65 735107.03 27.11%
2003 2Q Central 240177.63 831601.9 28.88%
2003 3Q Central 245502.85 816521.33 30.07%
2003 4Q Central 136540.24 533517.93 25.59%
2004 1Q Central 114608.1 546407.99 20.97%
2004 2Q Central 119156.12 539942.9 22.07%
2003 1Q NE 124915.62 735107.03 16.99%
2003 2Q NE 139753.83 831601.9 16.81%
2003 3Q NE 136735.48 816521.33 16.75%
2003 4Q NE 90414.14 533517.93 16.95%
2004 1Q NE 80012.9 546407.99 14.64%
2004 2Q NE 94615.41 539942.9 17.52%
2003 1Q SE 215673.22 735107.03 29.34%
2003 2Q SE 242570.81 831601.9 29.17%
2003 3Q SE 235134.88 816521.33 28.80%
2003 4Q SE 179762.23 533517.93 33.69%
2004 1Q SE 182502.66 546407.99 33.40%
2004 2Q SW 179333.25 539942.9 33.21%
2003 1Q SW 62762.27 735107.03 8.54%
2003 2Q SW 63238.55 831601.9 7.60%
2003 3Q SW 68552.6 816521.33 8.40%
2003 4Q SW 61301.1 533517.93 11.49%
2004 1Q SW 113640.5 546407.99 20.80%
2004 2Q SW 85152.37 539942.9 15.77%
2003 1Q West 132446.27 735107.03 18.02%
2003 2Q West 145861.08 831601.9 17.54%
2003 3Q West 130595.52 816521.33 15.99%
2003 4Q West 65500.22 533517.93 12.28%
2004 1Q West 55643.83 546407.99 10.18%
2004 2Q West 61685.75 539942.9 11.42%
Nov 13 '05 #1
1 4035
<<I have created a query that examines qarterly sales for 5 regions in the
country. The query contains data for the past 6 quarters for each region
......>>

You must have some criteria in the query that starts with today and goes
back 6 quarters from there. Since you want to add comparison to sales a year
ago, change the criteria so it only goes back 4 quarters. Then make a copy
of the query and in the copy, change the criteria so the copy starts with
the date a year ago today and goes back 4 quarters from there. Create a
union query from these two queries. The union query will then contain the
sales from the past 4 quarters as well as the four quarters previous to
that. You would create a crosstab query then for your form or report. To get
the comparison of current sales to previous quarter, do the calculation
directly on the form or report because both values will be there from the
union query. Your form or report will then look like the following assuming
3Q04 is the current quarter.:

4Q03 1Q04 2Q04
3Q04
Current Year 5MM 4.8MM 6.2MM
6.7MM(+.5MM)
Previous Year 4.3MM 5MM 4.8MM
5.8MM
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Terencetrent" <te*******@yahoo.com> wrote in message
news:83**************************@posting.google.c om...
I have created a query that examines qarterly sales for 5 regions in
the country. The query contains data for the past 6 quarters for each
region and calculates the perecentage of total sales for the quarter
fo each region.

To help enhance the report I would love to include a comparison to of
current sales to previous quarter sales and a comparison of current
sales to sales a year ago. I am having a devil of a time creating a
query to perform those actions. I am not skilled at VBA and was
hoping someone could provide me with the code that will make the
comparisons.

Below is the all of the data in my query.

Your help would be greatly appreciated!!

Quarter Region SumOfSALES SumOfSumOfSALES Percentage
2003 1Q Central 199309.65 735107.03 27.11%
2003 2Q Central 240177.63 831601.9 28.88%
2003 3Q Central 245502.85 816521.33 30.07%
2003 4Q Central 136540.24 533517.93 25.59%
2004 1Q Central 114608.1 546407.99 20.97%
2004 2Q Central 119156.12 539942.9 22.07%
2003 1Q NE 124915.62 735107.03 16.99%
2003 2Q NE 139753.83 831601.9 16.81%
2003 3Q NE 136735.48 816521.33 16.75%
2003 4Q NE 90414.14 533517.93 16.95%
2004 1Q NE 80012.9 546407.99 14.64%
2004 2Q NE 94615.41 539942.9 17.52%
2003 1Q SE 215673.22 735107.03 29.34%
2003 2Q SE 242570.81 831601.9 29.17%
2003 3Q SE 235134.88 816521.33 28.80%
2003 4Q SE 179762.23 533517.93 33.69%
2004 1Q SE 182502.66 546407.99 33.40%
2004 2Q SW 179333.25 539942.9 33.21%
2003 1Q SW 62762.27 735107.03 8.54%
2003 2Q SW 63238.55 831601.9 7.60%
2003 3Q SW 68552.6 816521.33 8.40%
2003 4Q SW 61301.1 533517.93 11.49%
2004 1Q SW 113640.5 546407.99 20.80%
2004 2Q SW 85152.37 539942.9 15.77%
2003 1Q West 132446.27 735107.03 18.02%
2003 2Q West 145861.08 831601.9 17.54%
2003 3Q West 130595.52 816521.33 15.99%
2003 4Q West 65500.22 533517.93 12.28%
2004 1Q West 55643.83 546407.99 10.18%
2004 2Q West 61685.75 539942.9 11.42%

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: tran.loan | last post by:
I have a reporting query that I need to do a quarterly trending on. A user enters a begining date and end date, and from there, I have to determine the closest quarter to it. Also, the actual...
1
by: PeteCresswell | last post by:
A "quarterly return" is the decimal amount that an investment returned over a given three-month period. The periods end on Mar, Jun, Sep, Dec Seems like there are a couple of ways to link a...
8
by: Laura | last post by:
I am working with a Business Development database. We need to generate a new report showing forecasted revenues by quarter. The data I am working with includes: Project, Revenue, POP Start, POP...
0
by: richardkreidl | last post by:
I have the following hash script that I use to compare two text files. 'Class Public Class FileComparison Public Class FileComparisonException Public Enum ExceptionType U 'Unknown A 'Add...
2
by: Bernd Hohmann | last post by:
Dear collegues, small query problem. A table (simplified example)... customer as char(5) inv_date as date amount as double
3
by: deltauser2006 | last post by:
My database consists of information which is updated every quarter. Forms will compare data from the present quarter to quarters past. I need a way to make the database save a copy of itself every...
2
by: mike_dba | last post by:
I am looking for SQL syntax that will enable me to subtract quarters from timestamps. Any suggestions? Pseudo-code example - YEAR( timestamp_column - 9 Quarters) I know that I can easily...
2
by: Supermansteel | last post by:
Our team does numerous tests each month. Each person can run a report to automatically tally up all the results for the quarter. I have then created a Form specifically to enter our Analysis for the...
4
by: gimme_this_gimme_that | last post by:
Is there a way to get the last day of the previous business quarter from DB2? For 10/21/2008 the day would be 9/30/2008. Thanks.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.