Desktop version

Main > Knowledge Base > 1C:Enterprise documentation > 1C:Enterprise User Manual > Appendix 1. Data composition system expression language > Functions > EVALEXPRESSION > 1C:Enterprise documentation > 1C:Enterprise User Manual > Appendix 1. Data composition system expression language > Functions > EVALEXPRESSION > 1C:Enterprise documentation > 1C:Enterprise User Manual > Appendix 1. Data composition system expression language > Functions > EVALEXPRESSION

EVALEXPRESSION

This function returns an expression for recording a specified grouping. This function has the following parameters:

If the parameter value is Group, values are calculated for the current group record of the grouping.

If the parameter value is NonResourceGroup, an expression is calculated for the first group record of the original grouping when calculating the function for a group record by resources.

When calculating the EvaluateExpression function with the NonResourceGroup value for group records that are not grouped by resources, the function is calculated in the same way as if with the Group parameter value.
When the data composition template composer generates a data composition template, it outputs an expression calculated using the EvaluateExpression function with the specified NonResourceGroup parameter as a grouping resource field. For other grouping resources, it outputs standard resource expressions.

If the parameter contains the Hierarchy string, the expression is calculated for the parent hierarchical record, if it exists, or for the whole group, if such a record does not exist. When generating an expression for the % in the hierarchy group field, the template composer generates an expression that contains a ratio between the resource expression and the EvaluateExpression function for the resource expression calculated for the current grouping with the Hierarchy calculation type.

  • First. Get the first grouping record. The expression whose result will define the shift from the beginning of the grouping may be specified in parentheses after this word. The resulting value must be a positive integer. For example, with First(3) the third record from the beginning of the grouping is retrieved.
    If the first record is beyond the grouping, it is considered that there are no records. For example, if there are 3 records and
    First(4) is specified, it is considered that there are no records.
  • Last. Get the last grouping record. The expression whose result will define the shift from the end of the grouping may be specified in parentheses after this word. The resulting value must be a positive integer. For example, with Last(3) the third record from the end of the grouping is retrieved.
    If the last record is beyond the grouping, it is considered that there are no records. For example, if there are 3 records and
    Last(4) is specified, it is considered that there are no records.
  • Previous. Get the previous grouping record. The expression whose result will define the shift back from the current grouping record may be specified in parentheses after this word. For example, with Previous(2) the previous from the previous record is retrieved.
    If the previous record is beyond the grouping (for example, you get Previous(3) for the second record of the grouping), the result is the first grouping record.
    If the previous record is retrieved for a grouping total, the result is the first record.
  • Next. Get the next grouping record. The expression whose result will define the shift forward from the current grouping record may be specified in parentheses after this word. For example, with Next(2) the next from the next record is retrieved.

    If the next record is beyond the grouping, it is considered that there are no records. For example, if there are 3 records and Next is specified for the third record, it is considered that there are no records.

    If the next record is retrieved for a grouping total, it is considered that there are no records.

  • Current. Get the current record.
    If a record is retrieved for a grouping total, the result is the first record.
  • BoundaryValue. Get a record by the specified value. The BoundaryValue keyword must be followed by an expression of the first order field that begins the fragment, in parentheses.
    The first record with an order field value greater than or equal to the specified value is retrieved. For example, if the Period field is used as an order field, this field has the values 01/01/2010, 02/01/2010, and 03/01/2010, and you get BoundaryValue(DateTime(2010, 1, 15)), a record with the date 02/01/2010 is retrieved.
  • First. Get the first grouping record. The expression whose result will define the shift from the beginning of the grouping may be specified in parentheses after this word. The resulting value must be a positive integer. For example, with First(3) the third record from the beginning of the grouping is retrieved.
    If the first record is beyond the grouping, it is considered that there are no records. For example, if there are 3 records and First(4) is specified, it is considered that there are no records.
  • Last. Get the last grouping record. The expression whose result will define the shift from the end of the grouping may be specified in parentheses after this word. The resulting value must be a positive integer. For example, with Last(3) the third record from the end of the grouping is retrieved.
    If the last record is beyond the grouping, it is considered that there are no records. For example, if there are 3 records and Last(4) is specified, it is considered that there are no records.
  • Previous. Get the previous grouping record. The expression whose result will define the shift back from the current grouping record may be specified in parentheses after this word. For example, with Previous(2) the previous from the previous record is retrieved.
    If the previous record is beyond the grouping (for example, you get Previous(3) for the second record of the grouping), it is considered that there are no records.
    If the previous record is retrieved for a grouping total, the result is the last record.
  • Next. Get the next grouping record. The expression whose result will define the shift forward from the current grouping record may be specified in parentheses after this word. For example, with Next(2) the next from the next record is retrieved.  
    If the next record is beyond the grouping, the result is the last record. For example, if there are 3 records and Next is specified for the third record, the result is the third record.
    If the next record is retrieved for a grouping total, it is considered that there are no records.
  • Current. Get the current record.
    If a record is retrieved for a grouping total, the result is the first record.
  • BoundaryValue. Get a record by the specified value. The BoundaryValue keyword must be followed by an expression of the first order field that begins the fragment, in parentheses.
    The last record with an order field value less than or equal to the specified value is retrieved. For example, if the Period field is used as an order field, this field has the values 01/01/2010, 02/01/2010, and 03/01/2010, and you get BoundaryValue(DateTime(2010, 1, 15)), a record with the date 01/01/2010 is retrieved.
  • Together. Define the previous and next records based on the order expression values.
  • Separately. Define the previous and next records based on a sequence of ordered records.

For example, a sequence is ordered by date:

1. January 1, 2001 M. Ivanov 10
2. January 2, 2001 S. Petrov 20
3. January 2, 2001 P. Sidorov 30
4. January 3, 2001 S. Petrov 40

If the Separately order option is used to process identical values, record 2 is previous to record 3. If the Together option is used, this would be record 1. With the Separately option, a fragment for the record that is current to record 2 is record 2. With the Together option, it would include records 2 and 3. Therefore, with the Separately option, the sum by the current record would be 20. With the Together option, it would be 50.

If Together is specified in the Start and End parameters, shifts for the First, Last, Previous, and Next positions cannot be specified.

Separately is the default option.

Next page: Parameter usage example




© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.