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!

Blank Fields, unable to sum or subtotal

Status
Not open for further replies.

ASTROPLASTICS

Technical User
Apr 14, 2005
2
US
I am using a formula like this:
If IsNull({LABOR_TICKET.TRANSACTION_ID}) then 0 else
IF{LABOR_TICKET.TRANSACTION_ID} <> PREVIOUS({LABOR_TICKET.TRANSACTION_ID})
THEN{LABOR_TICKET.GOOD_QTY} ELSE 0

this is in the detail section of my report. My first return is blank and I do not have the option to summarize or subtotal on this field. Because my field (labor_ticket.good_qty) appears numerous times within a group and I only want to calculate it once for that group I chose to use this formula. If there is an easier way I am open to ideas.
 
Change your formula to:

If IsNull({LABOR_TICKET.TRANSACTION_ID}) then 0 else
IF (onfirstrecord or
{LABOR_TICKET.TRANSACTION_ID} <> PREVIOUS({LABOR_TICKET.TRANSACTION_ID}))
THEN{LABOR_TICKET.GOOD_QTY} ELSE 0

-LB
 
Thank you so much for the help. The formula worked great as far as showing the first field. I still don't have the option to sum or subtotal this field though. Any ideas regarding this?

js
 
Try using variable to summarize, as in:

//{@reset} to be placed in the group header for any higher order
//group you want to subtotal:
whileprintingrecords;
numbervar subt := 0;

//{@accum} to be placed in the detail section:
whileprintingrecords;
numbervar subt := subt + {@yourformula};
numbervar gttot := grtot + {@yourformula};

//{@displsubtot} to be placed in the higher order group footer:
whileprintingrecords;
numbervar subt;

//{@displaygrtot} to be placed in the report footer:
whileprintingrecords;
numbervar grtot;

This will give you both group subtotals and a grand total.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top