Welcome Guest! Log in
Stambia versions 2.x, 3.x, S17, S18, S19 and S20 are reaching End of Support January, 15th, 2024. Please consider upgrading to the supported Semarchy xDI versions. See Global Policy Support and the Semarchy Documentation.

The Stambia User Community is moving to Semarchy! All the applicable resources have already been moved or are currently being moved to their new location. Read more…


When working with files, Stambia offers the possibility to create and use Computed Fields.

These particular fields, on which an expression is configured, are calculated at execution when the file is read.

It can be useful to simulate a Primary/Foreign Key for example in hierarchical files.

Note that Computed Fields should be used only for reading. They are "virtual" fields, they do not exist on the file, and the calculated values can vary at each execution.

 

Creating Computed Fields

To create Computed Fields, Right click on a file or record and choose New > Computed Field

addComputedField

 

Then fill the parameters corresponding to your needs.

computedFieldProperties

 

1 - Computed Fields have a different icon, to differentiate it from the normal fields.

2 - The Expression is the function which will be used to calculate the field.

The available functions are:

id()   Generates an ID
localPosition()  Indicate the record/row number
timestamp()  Generates a timestamp
uuid()  Generates an UUID

 

Using ancestor parameter

It is possible to make "links" between Computed Fields, like a Primary/Foreign key would do in a table.

For that, the Ancestor Level Base parameter has to be set.

Example:

ancestors

The two fields have the expression set to localPosition() and the cusPosNumber in the sub-record has the Ancestor Level Base parameter set to 1.

With this settings, each Phone of the same customer will have the same cusPosNumber, like a table Foreign Key would do.

 

Note:

  • If the ancestor is not set, a new value will be attributed to the field.
  • For Primary Key/Foreign Key simulation, you must use localPosition(). Especially if you have multiple sub-records, because the other expressions are generated on the fly and can vary for each of it.

 

Articles

Suggest a new Article!