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

Formula can't be used because it is used later 1

Status
Not open for further replies.

ganjass

Technical User
Dec 30, 2003
154
GB
Cr8
SQl server2000

Hi All,

I have created a report, where the logic has changed at the last minute. The report has 2 totals in the groupfooter based on a simple
@1 = runningtotal1 - runningtotal2
@2 = Runningtotal3 - Runningtotal4 calculation. the running totals are a combination of all invoices over the ser date paramter period.

I only need to show the Accounts where either @1 or @2 is negative. If i try using a group selection criteria it comes up with the formaula can't be displayed becuase it is evaluated later error message.

I have tried suppressing the group sections where (@1 >= 0 or @2 >=0) logic and it works as expected only it leaves blanks every where in the report and i can't get the report to suppress the blank parts and condense the formatted data left.

Any ideas?
 
You need to explain what parts of the group you want displayed. If you are only displaying the group footers, i.e., you are suppressing the group header and detail section, then you can use the running totals for suppression and also format the group footer to "suppress blank sections" in the section expert.

If you need to show the group header and/or detail section for the account group, then you will need to use conditional formulas instead of running totals (if you can) so that you can use suppression or group selection.

If you cannot use conditional formulas (you have duplicate values), then I think you would have to use a subreport in a higher section that passes the running total values back to the main report to be used for suppression--a last resort.

-LB
 
Lbass the format of the report is as so:

GH1 Accountno - Text Headers
GH2 Supplier - Text Headers
Details - Suppressed
GF2a Supplier name - Totals
GF1a Account Totals
GF1b Account Totals

I need to show everything when either GF1a or GF1b Totals are -ve, otherwise no info is required.

there may be an issue of duplication, i take it using whilprintingrecords formulae will also not be allowed in group selection?

thanks in advance
 
Right. If you're not sure about duplication, then unsuppress the details section and take a look at it. If you don't have duplicates, then use conditional formulas, as in {@condA}:

if {table.field} = "ConditionA" then {table.amt}

You can then use summaries of formulas like this in your group footer formulas, as in {@1}:

sum({@condA},{table.acctno})- sum({@condB},{table.accntno})

If you can insert a summary on a formula, then it can be used in a group selection formula. If the formula contains any elements that are dependent upon order of data, e.g., the next/previous functions or running totals, then you wouldn't be able to.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top