I use Access 97.
I have a table (tblJoinedData) which contains data I need to perform a complicated calculation on.
Basically the table contains data for the following (given in field names):
Item
Loc
Month (ie 1-12 numeric field)
Period (ie P1 - P12 text field)
PP
SR
AP
PP_AP (This number is a comparison for AP to PP - how much they planned to make vs what they actual made)
Here is some sample data:
Item Loc Month Period PP SR AP PP_AP
10001 CLDC 1 P1 100 100 50 -50
10001 CLDC 2 P2 500 400 300 -200
10001 CLDC 3 P3 100 100 400 300
What I need to do is creating a "rolling" sum of the PP_AP value.
In other words for the example above the new field (MTD) would look like this for each line above:
Item Loc Month Period PP SR AP PP_AP MTD
10001 CLDC 1 P1 100 100 50 -50 -50
10001 CLDC 2 P2 500 400 300 -200 -250
10001 CLDC 3 P3 100 100 400 300 50
So the value for each PP_AP gets added to the sum of MTD for the prior Month.
If anyone could help me figure out a way to accomplish this I would greatly appreciate it.
Thank-you in advance.
Lisa.
I have a table (tblJoinedData) which contains data I need to perform a complicated calculation on.
Basically the table contains data for the following (given in field names):
Item
Loc
Month (ie 1-12 numeric field)
Period (ie P1 - P12 text field)
PP
SR
AP
PP_AP (This number is a comparison for AP to PP - how much they planned to make vs what they actual made)
Here is some sample data:
Item Loc Month Period PP SR AP PP_AP
10001 CLDC 1 P1 100 100 50 -50
10001 CLDC 2 P2 500 400 300 -200
10001 CLDC 3 P3 100 100 400 300
What I need to do is creating a "rolling" sum of the PP_AP value.
In other words for the example above the new field (MTD) would look like this for each line above:
Item Loc Month Period PP SR AP PP_AP MTD
10001 CLDC 1 P1 100 100 50 -50 -50
10001 CLDC 2 P2 500 400 300 -200 -250
10001 CLDC 3 P3 100 100 400 300 50
So the value for each PP_AP gets added to the sum of MTD for the prior Month.
If anyone could help me figure out a way to accomplish this I would greatly appreciate it.
Thank-you in advance.
Lisa.