S
Susan
Hello,
I was just wondering if anyone could recommend a better way of calculating
the differences between two consecutive values. I’ve got a way of doing it
but it’s very slow and limited.
A bit of background info: I have an instrument that records the amount of O2
delivered (in mL) every 75 minutes to flasks. An experiment consists of 24
“flasks†and can run for several months. The output of the instrument are
text files which I link my database too. Each of these text files consist of:
Hr (time field, in minutes), mL O2 (gas delivered to the flask) and a comment
field (free text).
Every week (or so) I take a CO2 measurement from these flasks. I record that
I’ve done this in the comment field in the text file
I have two union queries, one which collates the ‘Hr’, ‘mL and ‘flask’. The
other has ‘Hr’, ‘Comment’ and ‘flask’
What I want to do is to calculate the amount of O2 delivered between each
CO2 sample. As each flask is running at slightly different times, the CO2
samples are not taken all at the same Hr in all of the flasks. I have another
table “sample_details†where I have “sampleâ€, “time_slice†and “sample_hrâ€.
Sample_hr is a lookup value off the comment field from the union query.
Time_slice allows me to align all the CO2 samples.
I then have a cross tab query (qry_crosstab_o2_co2trap) which results in the
mL O2 in each of the flasks at each time slice, eg:
Time slice [1] [2] [3] [4]
0 23 34 61 41
1 89 99 150 90
2 100 130 197 111
etc…
I then have a query which has the below calculation
mLDif1:
IIf([time_slice]=0,[1],(IIf([time_slice]=1,([1]-DLookUp("[1]","qry_crosstab_o2_co2trap","[time_slice]=0")),([1]-DLookUp("[1]","qry_crosstab_o2_co2trap","[time_slice]=1")))))
This does actually give me the difference in O2 delivered, where mLDif1 is
the difference in the O2 delivered in flask 1.
This query takes about 5-10 minutes to run and it only covers the first
three time slices (0,1 and 2)
Any suggestions???
I was just wondering if anyone could recommend a better way of calculating
the differences between two consecutive values. I’ve got a way of doing it
but it’s very slow and limited.
A bit of background info: I have an instrument that records the amount of O2
delivered (in mL) every 75 minutes to flasks. An experiment consists of 24
“flasks†and can run for several months. The output of the instrument are
text files which I link my database too. Each of these text files consist of:
Hr (time field, in minutes), mL O2 (gas delivered to the flask) and a comment
field (free text).
Every week (or so) I take a CO2 measurement from these flasks. I record that
I’ve done this in the comment field in the text file
I have two union queries, one which collates the ‘Hr’, ‘mL and ‘flask’. The
other has ‘Hr’, ‘Comment’ and ‘flask’
What I want to do is to calculate the amount of O2 delivered between each
CO2 sample. As each flask is running at slightly different times, the CO2
samples are not taken all at the same Hr in all of the flasks. I have another
table “sample_details†where I have “sampleâ€, “time_slice†and “sample_hrâ€.
Sample_hr is a lookup value off the comment field from the union query.
Time_slice allows me to align all the CO2 samples.
I then have a cross tab query (qry_crosstab_o2_co2trap) which results in the
mL O2 in each of the flasks at each time slice, eg:
Time slice [1] [2] [3] [4]
0 23 34 61 41
1 89 99 150 90
2 100 130 197 111
etc…
I then have a query which has the below calculation
mLDif1:
IIf([time_slice]=0,[1],(IIf([time_slice]=1,([1]-DLookUp("[1]","qry_crosstab_o2_co2trap","[time_slice]=0")),([1]-DLookUp("[1]","qry_crosstab_o2_co2trap","[time_slice]=1")))))
This does actually give me the difference in O2 delivered, where mLDif1 is
the difference in the O2 delivered in flask 1.
This query takes about 5-10 minutes to run and it only covers the first
three time slices (0,1 and 2)
Any suggestions???