Totals Aliases

You can assign aliases to totals fields – check points, for which totals are calculated, to access them later using the 1C:Enterprise script. To do so, you must specify the name of the alias after the check point expression, as it is done in the selection fields list.

The AS keyword can precede the totals alias. You can omit this word at all, but when indicated it improves the clarity and readability of the query text.

Example.

SELECT Doc.Product, Doc.Count, Doc.Reference.Number, Doc.Reference.Recipient
FROM Document.ExpInvoice.Contents AS Doc
ORDER BY Doc.Product
TOTALS SUM(Count) BY Doc.Product ONLY HIERARCHY AS Products

If alias is not specified, the system will provide a unique name for the total. In the above example, total will have the name Products.

1C:Enterprise Developer's Community