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!

Subtotal on a complex formula

Status
Not open for further replies.

Rena

Programmer
May 24, 2000
69
US
In my report I need to calculate the difference between two other values. One of the values is a formula:

@TC_OnHand

If {ssinvent.uomcost} = 'M' Then
({ssinvent.onhand} * {ssinvent.avgcost}) / 1000
Else
If {ssinvent.uomcost} = 'CWT' Then
({ssinvent.onhand} * {ssinvent.avgcost}) / 100

The other value is a SUM of @Total_Cost

@Total_Cost

If {ssinvent.uomcost} = 'M' Then
({bbinvmov.committed} * {ssinvent.avgcost}) / 1000
Else
If {ssinvent.uomcost} = 'CWT' Then
({bbinvmov.committed} * {ssinvent.avgcost}) / 100

So my difference formula (known as @OnHand_Allocated_Diff):

{@TC_OnHand} - Sum ({@Total_Cost}, {bbinvmov.matno})


CRW won't let me SUM the @OnHand_Allocated_Diff formula. Any suggestions?

TIA,
Rena
 
Rena,

When you say you cannot sum the formula, what error message are you getting? Is the formula above the ENTIRE formula?

You cannot sum a summary, anything evaluated WhilePrintingRecords, or anything that used the NexT() or Privious() functions.

You can also subtract one formula from another at the detail level, even if the details are suppressed or regardlesss if you even place the new formula on the report at all, and then sum the new formula.

Does this help? Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
Rena,

When you say you cannot sum the formula, what error message are you getting? Is the formula above the ENTIRE formula?

You cannot sum a summary, anything evaluated WhilePrintingRecords, or anything that used the Next() or Previous() functions.

You can also subtract one formula from another at the detail level, even if the details are suppressed or regardlesss if you even place the new formula on the report at all, and then sum the new formula.

Does this help? Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
The reason I say I cannot sum is because when I right click on the field the insert summary is not available.

The formula above is the entire formula (re-displayed here for clarity):

{@TC_OnHand} - Sum ({@Total_Cost}, {bbinvmov.matno})

It contains a summary which is probably what is causing the problem. I don't know how to get around this. I think this is how I got into trying to use variables (see previous thread you helped me on). But I've tried so many things I don't remember them all [smile].

My day is over and it is time to head home. I will check this on Monday. Thanks for all your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top