473,394 Members | 1,761 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,394 software developers and data experts.

Change Between Periods

Dear NG - I'm very new to Access and would appreciate some guidance.
My table looks like the following:

Year County VarA VarB VarC etc.
1982 Athens 900 50 11.7
1983 Athens 700 40 21

All I want to do is calculate the % change in Variables A, B, and C
from 1982 to 1983. I know this should be very easy, but I'm not sure
how to do it.

Any general guidance would really be appreciated.

Mike

Sep 5 '06 #1
3 1222
Mike -
In a spreadsheet this is easy. In your table, the way it is set up,
it is not.

You have a few options. You can write the values into an array,
which would handle this particular example well. You can also
transpose your data, which would be a good idea if you plan on adding
more records to the dataset later on.

I think you should consider changing the dataset to something more
attuned to how you're going to look at it. Possibly change the
structure so there are 4 fields; Year, County, Var and Value so that:
1982 Athens VarA 900
1982 Athens VarB 50
1982 Athens VarC 11.7

You could then join the table to itself where Year = Year - 1. This
way you could have in one query:
Country Var Val1 Val2
Athens VarA 900 700

Then you would just create a new column in a query: PctChg: (Val2 -
Val1) / Val1

Takeadoe wrote:
Dear NG - I'm very new to Access and would appreciate some guidance.
My table looks like the following:

Year County VarA VarB VarC etc.
1982 Athens 900 50 11.7
1983 Athens 700 40 21

All I want to do is calculate the % change in Variables A, B, and C
from 1982 to 1983. I know this should be very easy, but I'm not sure
how to do it.

Any general guidance would really be appreciated.

Mike
Sep 5 '06 #2
Hey - (I feel strange calling you "ManningFan" as I'm sure this isn't
your real name) - Your response just turned a big, bright light on in
this little brain of mine. The issue is database design. I've often
wondered about how to best set up my data and I think I just found the
answer. What you've proposed makes all the sense in the world! I'm
always looking at differences between years and I'm always transposing
my data to do that (in SAS, that is, as I'm new to Access). It never
occured to me to restructure my data as you've suggested.

I have separate tables with deer-car crashes, harvest, crop damage
complaints, etc. I could combine all that into a single table if I set
it up as you've suggested. My only concern would be missing values for
some fields in some years. Do you see that as a big problem?

What a great idea!

Mike

ManningFan wrote:
Mike -
In a spreadsheet this is easy. In your table, the way it is set up,
it is not.

You have a few options. You can write the values into an array,
which would handle this particular example well. You can also
transpose your data, which would be a good idea if you plan on adding
more records to the dataset later on.

I think you should consider changing the dataset to something more
attuned to how you're going to look at it. Possibly change the
structure so there are 4 fields; Year, County, Var and Value so that:
1982 Athens VarA 900
1982 Athens VarB 50
1982 Athens VarC 11.7

You could then join the table to itself where Year = Year - 1. This
way you could have in one query:
Country Var Val1 Val2
Athens VarA 900 700

Then you would just create a new column in a query: PctChg: (Val2 -
Val1) / Val1

Takeadoe wrote:
Dear NG - I'm very new to Access and would appreciate some guidance.
My table looks like the following:

Year County VarA VarB VarC etc.
1982 Athens 900 50 11.7
1983 Athens 700 40 21

All I want to do is calculate the % change in Variables A, B, and C
from 1982 to 1983. I know this should be very easy, but I'm not sure
how to do it.

Any general guidance would really be appreciated.

Mike
Sep 5 '06 #3
I don't think missing values will react any differently no matter how
you set it up. You could always just use Nz() to convert nulls to
zeroes, and error-trap or flag records that are effected by them.

If that helps you out I just ask one thing: Pay It Forward, Mike.

Takeadoe wrote:
Hey - (I feel strange calling you "ManningFan" as I'm sure this isn't
your real name) - Your response just turned a big, bright light on in
this little brain of mine. The issue is database design. I've often
wondered about how to best set up my data and I think I just found the
answer. What you've proposed makes all the sense in the world! I'm
always looking at differences between years and I'm always transposing
my data to do that (in SAS, that is, as I'm new to Access). It never
occured to me to restructure my data as you've suggested.

I have separate tables with deer-car crashes, harvest, crop damage
complaints, etc. I could combine all that into a single table if I set
it up as you've suggested. My only concern would be missing values for
some fields in some years. Do you see that as a big problem?

What a great idea!

Mike

ManningFan wrote:
Mike -
In a spreadsheet this is easy. In your table, the way it is set up,
it is not.

You have a few options. You can write the values into an array,
which would handle this particular example well. You can also
transpose your data, which would be a good idea if you plan on adding
more records to the dataset later on.

I think you should consider changing the dataset to something more
attuned to how you're going to look at it. Possibly change the
structure so there are 4 fields; Year, County, Var and Value so that:
1982 Athens VarA 900
1982 Athens VarB 50
1982 Athens VarC 11.7

You could then join the table to itself where Year = Year - 1. This
way you could have in one query:
Country Var Val1 Val2
Athens VarA 900 700

Then you would just create a new column in a query: PctChg: (Val2 -
Val1) / Val1

Takeadoe wrote:
Dear NG - I'm very new to Access and would appreciate some guidance.
My table looks like the following:
>
Year County VarA VarB VarC etc.
1982 Athens 900 50 11.7
1983 Athens 700 40 21
>
All I want to do is calculate the % change in Variables A, B, and C
from 1982 to 1983. I know this should be very easy, but I'm not sure
how to do it.
>
Any general guidance would really be appreciated.
>
Mike
Sep 5 '06 #4

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

Similar topics

3
by: Michel | last post by:
Is there a free PHP scipts where a admin after loggin-in, knowing nothing about PHP or HTML, can online change his pages like using a wordprocessor like MS-word? Thanks
1
by: Graeme Longman | last post by:
Hi everyone, I was wondering if anyone has written some Python code which uses a start date and end date and a given interval (day, month or year) and outputs all the time periods for that range...
8
by: Matt Herson | last post by:
I have been trying to find a way to use JavaScript to change the value of a hidden field on submit. I am already invoking a JavaScript to handle the validation on submit. The reason I need to...
2
by: Jacobus Terhorst | last post by:
By accident all spaces and tabs are now showing up as 'periods' and 'arrows' .. How on earth to I do I reset this to the normal setting? Jacobus
8
by: Joseph | last post by:
I have a textBox that people writes stories in it. They can use for format. I have Aspell installed on the server, so people can make correction to their text. Sometimes, they forget to add a...
3
by: MLH | last post by:
I have a block of text with about 19,000 characters - alphanumeric, punctuation, hard returns, etc... I would like to count the number of periods ( Chr$(46) ) appearing in the document. Whats a...
2
by: John Buell | last post by:
When I generate an html email to send via SmtpMail, it will (apparently) randomly remove a period in the filename for some image and anchor tags, but not all For example, in the email body, i may...
4
by: GatorBait | last post by:
Hi, I have created a class library that I call from within my program using late binding. The class library contains a form and I allow the user to do different actions on the form that is part of...
5
by: joeblast | last post by:
I have a Web service that gets the financial periods and hold a reference to a disconnected dataset built at initialization. Web methods work on the dataset inside the web service. Everything is...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.