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!

Unable to create a summary field on a formula field 1

Status
Not open for further replies.

TimBiesiek

Programmer
Nov 3, 2004
151
AU
Hi All,

I am trying to create a summary field on a formula field within Crystal Reports, however, the formula I am trying to summarise does not appear in the list of available fields to summarize...

Some of the records for the formula are nulls... I thought this may be the reason?

Any help??
pcguru.gif
 
Tim,

The formula may be a Print Time formula (a formula that is calculated during the printing of the report as opposed to while the report is reading from the database.

In this situation - you may need to use a running total or even store values in variables and then display the variable where the total should be.

I hope this helps

Cheers
paulmarr
 
The presence of nulls wouldn't stop a formula being summarised - this does cause blank output, unless you use insull, but that's a separate problem. The usual reason is that the formula contains a summary.

What are you trying to do? Could it be done by a Runnning Total, which can count or add based on a formula?

It also helps to say which Crystal, though for the topics mentioned, all versions would be the same.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Hi guys,

Thanks for your quick responses!

Formula I would like to sum is:

Code:
if isnull({@RawFactor}) then
    1
else
    (sqr(sqr({@RawFactor})))*{@Attainment}

Using CR9...

I can't even create a running total on this field. It's not in that list either....
 
When posting formulas you should always post the contents of nested formulas as well. I'm guessing that one of the nested formulas contains a summary. You can use a variable to sum this, by creating two formulas:

//{@accum} to be placed in the where your formula is located:

whileprintingrecords;
numbervar x := x + {@yourformula};

//{@displ} to be placed in the report footer:

whileprintingrecords;
numbervar x;

If you are trying to summarize at a group level, then add a reset formula in the group header:

whileprintingrecords;
numbervar x := 0;

...and place the display formula in the group footer.

-LB
 
Please post the formula for {@RawFactor} as well, plus any formulas it refers to. Also where is {@rawfactor} on the report canvas? Details section?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports
 
Heh heh.... I had started to copy and paste the other interelated formulas, but then thought 'Oh, they might not need them....' Duh!

Here's the other formulas:

RawFactor:
Code:
{@ActualRate}/{arc_Round.TargetRate}

Attainment:
Code:
({dlgV_057_ArchiveReadTypeR.Expr1}/{dlgV_058_ArchiveReadType.Expr1})*100

Actual Rate (Basic Syntax):
Code:
if {dlgV_056_HourDuration.HourDuration} = 0 then    
    formula = DistinctCount ({arc_FieldResult.ResultID}, {arc_Round.ArchivedSessionId})
else
    formula = DistinctCount ({arc_FieldResult.ResultID}, {arc_Round.ArchivedSessionId})/{dlgV_056_HourDuration.HourDuration}
end if
 
I want to display all theses formulas on the same area of canvas - a group header....

Then I want to summarise the points formula in the 2nd group footer... I will also want to summarise the points summary for the parent group.
 
Thanks LBass! Your solution worked! I have now got it to summarise the points formula by using your method! Thanks! [rofl2]
 
If you use the variable method, you can only display the results in a footer section, not a header section--although you could calculate the results in a subreport which uses variables, link the subreport to the main report on the group field, and place the subreport in the group header, if having the results in the group header is critical.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top