Skip to main content

Value field functions in Template Editor

Modified: 21 Apr 2023 Tekla Structures 2023
2023
Tekla Structures

Value field functions get and summarize data from other value fields in the template. You can access them in the Formula Contents dialog box and in the Rule Contents dialog box.

In order to access the parameters of the function click Select in the Value Field area of the dialog box. This opens the hierarchical list of value field names. The parameter must appear inside parentheses and double quotation marks (" ").

Note:

Value field functions get values from all processed fields - from the duplicate lines that may have been excluded from the output, and from invisible value fields.

GetFieldFormula

Use this function when you want to query the value of a given value field. You can also combine several field formulas into one.

This rule outputs all rows that fulfill the statement:

CopyField

This function is intended for copying summary fields from other locations in the hierarchy. CopyField always copies the source value from other locations, even if the row is hidden.

It is possible to copy a value from:

  • a sub-row to an upper row

  • an upper row to a sub-row

  • a row to another row

  • a row to a header

  • a row to a footer

  • a header to a row

  • a footer to a row

  • a Sum field

For a header, page headers, page footers or a footer, the function copies the value of the given value field to itself.

If this function is used in row rules, it only copies the values from the row itself and not from other rows at the same level in the hierarchy or rows lower in the hierarchy.

Note:

A value field containing the CopyField function cannot be sorted.

In this example, there is an ASSEMBLY row with two rows on a lower level. One of the lower rows is a PART row and the other one is a SUMMARY row.

The SUMMARY row has a value field Summary_field containing the following formula:

The calculated weight is shown on the ASSEMBLY row in a value field with the following formula (and you can hide the SUMMARY row):

See also

Hiding template rows from output in Template Editor

CopyField reference cases

If CopyField is used in value fields in rows, it searches for the value field values in different locations depending on where the source field is. Below are the cases how CopyField works to find the relevant values in sequential order.

Case

Scenario

1

CopyField searches for the source field in the same row.

2

CopyField searches for the source field in the same row hierarchy above where it has been placed (i.e. from child row to parent row).

3

CopyField searches for the source field in the same row hierarchy below where it has been placed (i.e. from parent row to child row).

4

CopyField searches for the source field outside of the hierarchy in the rows below where CopyField has been placed.

5

CopyField searches for the source field outside of the row hierarchy in the rows above where CopyField has been placed.

Sum

Use this function when you want to calculate the intermediate sum of a numeric value field. The data type is Number or Number with decimals. All proceeding values of the parameter before the current output row are counted, and the sum is reset to zero every time after the row is output.

This function is not available for row rules.

To calculate the total sum instead of this intermediate sum, use the Total function instead.

This formula calculates the intermediate sum of the value field WEIGHT_T and is multiplied with the total value of the model.

Total

Use this function when you want to total the sum of a numeric value field. All the processed values of the value field are counted.

This function is not available for row rules.

The following formula totals the embedded assembly weight in pounds.

Count

Use this function when you want to calculate the number of value fields that have been output before the current output row. The count is reset after output.

This function is not available for row rules.

To calculate the total number of value fields processed instead of this intermediate count, use the All function instead.

This formula returns the intermediate count of value fields with the name Drawing_Name.

All

Use this function when you want to calculate the number of value fields that have been output before the current output row.

This function is not available for row rules.

This formula calculates all the previously handled value fields named ValueField_1.

Submit

Table of Contents