Calculating on a detail field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am unsure how to select one detail field to perform a calculation.
Within the Detail Section I have:
Status and then Days of the month across the page.
When the report is run I have 6 lines with the different status available.
I want to be able to say - if the status = On then divide On by ON + Sl etc.
How do I do this?
 
Can you help us by providing some field names, sample records, and desired
display in the report?
 
Page Header:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

Detail:
Type:
ON 1 1 8
15
Sl 1 3 6 8 9
TC
LS 1 2 4 6 7
RR 4 7 5 16

I have the days of the month across the page with the types and the amounts
per day.
Thank you for any help you can give
 
To calculate this in a group or report footer, try an expression like:
= (Abs([Status]="ON")*[1]) / ( (Abs([Status]="ON")*[1]) +
(Abs([Status]="SI")*[1]) )

If you need totals for each day, you can copy the expression and replace [1]
with [2],....
 
I still can't seem to get it to work.
If I try:
= (Abs([Status]="ON")*[1]) / ( (Abs([Status]="ON")*[1]) +
(Abs([Status]="SI")*[1]) )
Then ON will only divide by ON - it takes no notice of the SI.
Is there anything I can do.
Thank you
Duane Hookom said:
To calculate this in a group or report footer, try an expression like:
= (Abs([Status]="ON")*[1]) / ( (Abs([Status]="ON")*[1]) +
(Abs([Status]="SI")*[1]) )

If you need totals for each day, you can copy the expression and replace [1]
with [2],....

--
Duane Hookom
MS Access MVP
--

Icmeler said:
Page Header:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

Detail:
Type:
ON 1 1 8
15
Sl 1 3 6 8 9
TC
LS 1 2 4 6 7
RR 4 7 5 16

I have the days of the month across the page with the types and the
amounts
per day.
Thank you for any help you can give
 
It's okay - I've worked out the formula based on your advice.
Thank you for your help.

Duane Hookom said:
To calculate this in a group or report footer, try an expression like:
= (Abs([Status]="ON")*[1]) / ( (Abs([Status]="ON")*[1]) +
(Abs([Status]="SI")*[1]) )

If you need totals for each day, you can copy the expression and replace [1]
with [2],....

--
Duane Hookom
MS Access MVP
--

Icmeler said:
Page Header:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

Detail:
Type:
ON 1 1 8
15
Sl 1 3 6 8 9
TC
LS 1 2 4 6 7
RR 4 7 5 16

I have the days of the month across the page with the types and the
amounts
per day.
Thank you for any help you can give
 
Back
Top