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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Total on Formula Field 3

Status
Not open for further replies.

dunkyn

Technical User
Apr 30, 2001
194
US
The running total option does not display the field I need to total.

Any suggestions on a work around?
 
Can you give some details on the formula field you're trying to total?

Just had a similar problem like this, but I'd need to see it to really give any help.
 
Here is my formula:

whileprintingrecords;
If {@MySectorName}= "Consumer Discretionary" then 13.4

Else If {@MySectorName}= "Consumer Staples"then 9.5

Else If {@MySectorName}= "Energy" then 6

Else If {@MySectorName}= "Financials" then 20.5

Else If {@MySectorName}= "Health Care" then 14.9

Else If {@MySectorName}= "Industrials" then 11.5

Else If {@MySectorName}= "Information Technology" then 14.3

Else If {@MySectorName}= "Materials" then 2.8

Else If {@MySectorName}="Telecommunication Services" then 4.2

Else If {@MySectorName}="Utilities" then 2.9

Else If {@MySectorName}="Miscellaneous" then 0

Else 0
 
Chances are the field that your trying to create the running total on is a formula field that required some coding? If that is the case you could always do a manual Running total. What are you trying to get with the original formula?
 
I could be wrong, but I dont think you need the "whileprintingrecords."

If you can get rid of that, you should be able to do the running total.

Noxum, I've found that if a field isn't available in the list while making a Running Total Field, you cant make a manual running total [Count({fieldname})] because it will error at you about not being able to create the running total field.

 
If you are trying to get the running total of the result of that formula this is one way to do it:

//place this formula in the section that you want the total
//to reset in.
//(ie place in GH1 for a seperate running total for each group)
//**don't reset if for a grand total
FORMULA 1:
shared numbervar val:=0;

//place this formula in the same section as the existing
//formula. In preview you should see the formula adding up
FORMULA 2:
shared numbervar val:= val + {@exisiting_Formula}

//place this formula in the section you want the total to
//be displayed in.
FORMULA 3:
shared numbervar val;
val;

You can suppress formula 1&2 once you get the desired results
Hope this helps
Nate B
 
Thanks, putts. I removed the whileprintrecords; and I can get a total, but it is totalling all of the detail records. I just want a total for each group. (These are fixed percentages that must add up to 100%).

I haven 't looked at Noxum's advice yet. I'll try that next.

Thanks to all. Very much appreciated.
 
Just use the conditional Count function.

Count({fieldName},{FieldGroupedBy})

Note: this is how you do it through a custom formula field.
If you do it through a Running Total Field, use the Reset On option and select the group you want it to reset on.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top