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

Creation of Calculated field in Crystal Reports XI

Status
Not open for further replies.

karnd

Programmer
Feb 1, 2003
190
US
Hi,

I have the following scenario-I have 2 records one is in group section and another is in Detail section
Eg:
1st rec Citibank $1000
2nd rec Personal Act $500

But i have to create another record which is substraction of 1st and 2nd records so in the record it displays $500

I would not able do it by using formula fields in the Field Explorer so any ideas should be really helpful.

Thanks in an advance
Regards,
 
How did you get the "record" in the group section? What fields are you using? A group section ordinarily contains a groupname and a summary. If "Citibank" is a group instance, is $1000 a group summary? If so, what happened to the other detail records?

To subtract a record from a summary, you could use a formula like:

sum({table.amt},{table.group}) - {table.amt}

Or if instead you are subtracting the current record from the previous one, you can use:

previous({table.amt}) - {table.amt}

-LB
 
Hi LB,

Amount field has brought into the group section and Detail section because of the report requirements so it will be deducted from one another to display it in the 3rd record.But the BankName has grouped so that the amount has pulled into the grouped BankName section and also similarly the AccountInfo has grouped sothat used the same AccountInfo grouped item in the Detail Section (for the report requirement again) along with the same amount field in the detail section.

Eg: Group section - CitiBank - $1000
Detail section - Personal - $500
----
3rd record $500

Unfortunatly, none of the above solution should not be used to get it done because i would able to see only Reportfield items for the amount but not Grouped items for the amount when edit the Formula Fields.

Also tried selecting the 2 records for amounts and then edited Formula Fields but no use.

Any other work around inorder to get it done really helpful.

Thanks a lot,
Regards,



 
Hi LB,

Yep, I got you with your expression.

Thanks again for your kind help.

Regards,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top