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

Subtotaling a formula field

Status
Not open for further replies.

netraker

MIS
Dec 10, 2003
1
0
0
US
Description: My report has three group section. On the 3rd group, I have a field that is based on a formula.

Problem: I can't seem to create a subtotal or a grand total of the field. I get "the summary/running total can not be created error". I have a vague idea that its because its a formula/group based field so i cant use it on a summary. So, how do I total the field on the report if I can't even see it as a selection when I try to create a subtotal for it?

thx
 
If the formula includes any summary functions, you won't be able to use the usual summaries on the formula for subtotals. You could try the three formula method for creating manual running totals.

For further help you need to provide the contents of the formula and also explain the subtotals you want, e.g., do you want a sum of the formula at the Group 3 footer level? It's also unclear whether the formula you want to summarize is in the details section or in a group section.

-LB
 
Okay, here's the three-formula method:

{@reset} to be placed in the group header:
whileprintingrecords;
numbervar sumgrpcntxqty := 0;

{@sumgrpcntxqty} to be placed in the details section:
whileprintingrecords;
numbervar sumgrpcntxqty := sumgrpcntxqty + DistinctCount ({CLASS.xlocator}, {CLASS.xname}) * {CLASS.cdays};

{@display} to be placed in the group footer section:
whileprintingrecords;
numbervar sumgrpcntxqty;

You can suppress the formulas in the group header and details section.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top