CalculationRegisterManager.<Calculation register name>.GetBase

Syntax:

GetBase(<Filter>, <Resources>, <Dimensions>, <ViewPoints>)

Parameters:

<Filter> (required)

Type: Structure; Filter.
If a parameter belongs to the Structure type, it is a filter for register records, for which the base is obtained. Structure element names must either contain the word "Recorder" or be the same as dimension names of the calculation register. Structural element values are, in fact, the filtering values. At least a recorder condition must be present.
If the parameter belongs to the Filter type, it is a filter, for which the base is obtained. Filter must at least use recorder filtering element. All filter elements must set condition with "Equal to" comparison option.

<Resources> (required)

Type: Array.
The array of strings is a list of base calculation register resources which you want to sum.
Each array item is a string where you specify the base calculation register resources separated by commas as they are specified in the Configuration Manager set as <Calculation register name>.<Resource name>.

<Dimensions> (required)

Type: Structure.
Each structural element sets a list of dimensions for basic calculation registers, which will be used for base selection. Structure element names should be the same as names of dimensions of the current register and structure element values should be fields with comma-separated list of basic register dimensions.
If a calculation register has dimensions D1, D2, D3, you can set no more than three method parameters. The first of them is the base register dimension list compared with D1, the second is the base register dimension list compared with D2 and so on.
Dimension names are set as <Calculation register name>.<Dimension name>.
If you skip a parameter, you don't impose conditions on the corresponding dimension.

<ViewPoints> (optional)

Type: Array.
Sets the dimensions and attributes of the base calculation registers by which you want to compose the base.
The <Dimensions> parameter specifies a structure which sets rules of the base register dimensions and the current register dimensions comparison, and the <ViewPoints> parameter specifies the base register dimensions and attributes array in context of which the base will be composed.
If you set a parameter, the values table you obtain has in general more rows than there are register records for the recorder specified.
If you don't set a parameter, the number of rows in the values table obtained is equal to the number of register records for the specified recorder.

Returned value:

Type: ValueTable.

Description:

Obtains the base for the register records complying with the filter specified (usually with the recorder).
The returned values table contains the "LineNumber" column and columns with calculated resources (the quantity is set by the <Resources> parameter) and with specified viewpoints (quantity is set by the <ViewPoints> parameter).

Availability:

Server, thick client, external connection.

Example:

Filter = New Structure();
Resources = New Array(1);
Resources[0] = "MainChargesDistribution.Result";
Dimensions = New Structure("NatPers,Organization,Department,Post");
Dimensions.Insert("NatPers","MainChargesDistribution.NatPers");
Dimensions.Insert("Organization","MainChargesDistribution.Organization)";
Dimensions.Insert("Department","MainChargesDistribution.Department");
Dimensions.Insert("Post","MainChargesDistribution.Post");
ViewPoints = New Array(1);
ViewPoints[0] = "MainChargesDistribution.DistributionType";

Registr = CalculationRegisters.FocalChargesOrg;
RecordsSet = Registr.CreateRecordSet();
DocumentsOfCharges = Query.Execute().Unload();
For 
Each Document In DocumentsOfCharges Do
    Filter.Insert("Recorder",Document.Recorder);
    Data = Registr.GetBase(Filter,Resources,Dimensions,ViewPoints);
    SummaryBaseData = Data.Copy();
    SummaryBaseData.GroupBy("LineNumber","Result");
    RecordsSet.Filter.Recorder.Value = Document.Recorder;
    RecordsSet.Read();
    FocalData = RecordsSet.Unload();

    // process lines of the recordset
    // ...
EndDo;

See also:

Filter
FilterItem

    

1C:Enterprise Developer's Community