Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Running Total 'Total' in formula

Status
Not open for further replies.

MrHawkins

Programmer
Sep 24, 2002
21
GB
I'm pulling my hair out over this one .... !

I've got a report using a running total to count values based on a formula. The formula flags certain values as true based on their value, then only the 'true' values are counted in the running total; if it's false then 0 is displayed.

(God describing these reports is painful!)

I now need to display a percentage value for this count, I'm really struggling to use the total of the running field elsewhere in the report due to the nature of the function.

Here's and exmaple of the data

Count % of Count
4 Should be 5/4
1 Sould be 5/1
0 0
0 0
0 0

Total
5

Because the running total affectively hasn't happened due to the report grouping, instead of the count being divided by the total, it's divided by the current stage of the running total.

Count % of Count
4 Actually 4/4
1 Actually 5/1
0 0
0 0
0 0

Total
5

This is a generic report so I can't just 'bodge' the figures in, but I'm lost for how to use the total value from the end of the running total function, or generate the value another way.

Thanks in advance for any help.
 
From your explanation it's not clear why you are using running totals to display the total count, and you didn't share the formula used to evaluate whether a value is true or false.

would it not be possible to create a formula field using your logic to set the value as 0 or your value i.e.

If 'Your logic here' = True Then
Table.Value
Else
0

You should then be able to use the summary sum and count functions to create your totals.

HTH

Gary Parker
MIS Data Analyst
Manchester, England
 
Sorry for the poor explanation, and I've solved the problem now (thank god!).

The reason for using the running total was to be able to do a count with a WHERE clause using a group. It's the only way I've found you can do this!

To solve this I used a subreport to generate the value - then a shared variable to pass the value to the formula in the main report.

VERY useful ability - would recommend anyone to look at it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top