Calculating Overall Totals

To calculate totals for the entire table, you must use the word OVERALL in the TOTALS clause. In this case, aggregate functions values for all the records of the table will be calculated.

Example:

SELECT Doc.Product, Doc.Count, Doc.Reference.Number, Doc.Reference.Recipient
FROM Document.ExpInvoice.Contents AS Doc
TOTALS SUM(Count) BY OVERALL

Query result:

Product

Count

Number

Recipient

238 

 Faucet

10 

001

Urupinsk products

 Faucet

003

“Master” Store

 Faucet

44 

003

“Giant” Store

 Faucet

22 

003

Urupinsk products

Plunger

001

Urupinsk products

Plunger

003

“Master” Store

Plunger

14 

004

“Giant” Store

Table

001

Urupinsk products

Table

15 

002

“Furniture” Store

Table

10 

004

“Giant” Store

Chair

55 

002

“Furniture” Store

Chair

003

“Master” Store

Chair

32 

004

“Giant” Store

Chair

16 

005

Urupinsk products

1C:Enterprise Developer's Community