If you refer to a summary field in a calculation, you get a grand summary based on all the records in your found set. To refer to a sub-total, you need to use the GetSummary function. The "break field" parameter in this function should be the same field as the "sorted by" field you specify in the set up for your sub summary part.
Everyime i try to make it a get summary function i keep getting a "Only summarys are allowed as the first arguement in a Getsummary function"
You have this format for the GetSummary function:
GetSummary ( SummaryField ; Break Field )
Let's say you have a summary field, sTotal, that computes the total quantity of invoice line items and it is defined in the Line Items table.
You create a summary report with a Sub Summary part "sorted by" the Invoice ID field so that this summary field computes the total for each invoice, provided you sort your records by Invoice ID so that line item records from the same invoice are grouped together.
If you want to use this Invoice Subtotal in a calculation, you can do this:
GetSummary ( sTotal ; InvoiceID ) // and records must be sorted by InvoiceID
Well i got it setup up to show me the total Discount number. how i can i use that to set up to minus the order total. make it a little bit simpler for me. cause it seems i cant do it the way your telling me. any tips would be great
This only works with summary fields. If you are using calculiaton fields with aggregate functions such as Sum(), Average(), Count(), etc., you need to take a different approach.
What is your "total discount number" the total of and how did you set it up? What field definition are you using to compute the order total?
This is how i setup discount total
Invoice LineItems Table::Discount Total: Summary Total of Discount
This is how i got my order total. Ignore discountin the order table thats a total discount for the order total i got individual discounts i need to factor in.
Invoices Table::Subtotal:Calculation Sum ( Invoice Lineitems::Subtotal )
Invoices Table::Order Total: Subtotal - Discount + Shipping
Define this field in LineItems to compute a category total that includes the discount total for the same category:
sOrderTotal: Total of Subtotal // specify whatever field computes the total cost of one line item record
Now GetSummary ( sOrderTotal ; CategoryField ) - GetSummary( sDiscountTotal ; CategoryField )
This works as long as your line items records are sorted by CatogoryField.