Projection – Abstract
Purpose: Returns a section from a string determined by a projection.
Tooltip
Usage: The Sub string projection returns a section from a string determined by the Projection. The section is defined by the Begin index and Max. length parameters.
Parameter: The parameters are formally optional, but should be explicitly supplied with suitable values (see 'Warning' below).
The Projection should provide a string via a projection (see Projections).
The Begin index should provide an
Integervalue by resolver or projection. It determines the start position for taking over characters from the return value of the Projection.A Begin index of 1 refers to the first character from the Projection.
The Max. length should provide an
Integervalue per resolver or projection. It limits the maximum number of characters that are transferred from the Projection into the return value.Warning: For the Begin index and Max. length parameters, positive
Integervalues should be provided explicitly to ensure consistent results on different database systems. Other parameterizations (via resolvers/projections) are possible, but may produce errors or inconsistent results depending on the database system used.

The Sub string projection returns a section from a string determined by the Projection.
The optional Begin index and Max. length parameters control which section of the return value from the projection is returned as a 'substring'.
Configuration
CAUTION
Depending on the database system used, the results of a Sub string projection can vary significantly. The user interface presented here technically allows parameterizations that only work on certain databases.
The documentation in the following section is limited to parameter combinations that provide the described results regardless of the database system used.
Different parameter combinations are technically feasible in practice, provided that the desired results are achieved in tests with the database system used.
However, it should be remembered that if the database system for an existing implementation is changed at a later date, or if solution components are exchanged between Lobster Data Platform / Orchestration systems that use different database systems, serious malfunctions and significant deviations from targeted processing logics may then occur, the cause of which may only be localizable with considerable effort and may not be completely remedied in the context of the 'alternative' database system.
In the following table, the green shaded cells refer to the use of the parameters, which should be guaranteed regardless of the database system.The yellow shading, on the other hand, indicates references to the use of the parameters outside the 'strict' default.
Parameter | Type | Description |
|---|---|---|
Name optional |
| The Name parameter optionally defines an alias name for the projection. If no Name is specified, the name of the Projection with the static prefix 'substring of ' will be used as the name. |
Projection optional |
| A Projection (see Projections) of any type (e.g. also a Literal projection) can be used as a projection as long as it returns a
|
If the projection returns a data type other than a â–ºNOTEâ—„ If a database system does not accept the values of a data type other than the | ||
Begin index optional |
| The Begin index defines the position within the sequence obtained from the Projection via an
A positive
|
If there is no value ( â–ºNOTEâ—„ Some database systems interpret a negative Begin index as an offset from the end of the evaluated string. | ||
Max. length optional |
| The Max. length parameter defines an upper limit for the length of the string in the return value via an
The same options and restrictions apply for the parameterization as for the Begin index. |
If there is no value ( |
Examples
Simple example: Concatenate country code and postal code area
Based on the 'country' ( Specifically, the first two digits (or characters) of the 'ZIP code' are concatenated with the internal abbreviation for Country to obtain a four-digit code when both fields are properly populated. The table on the right shows sample data for a selection of cities in Germany and Switzerland in the first column ( |
|
Configuration:
The screenshot on the right shows the configuration for the projection of the first column (
|
|
More complex example: A variable number of digits depending on the length of the ZIP code
Based on the previous use case, a variable number of leading digits from the ZIP code (zipcode) is now transferred to the identifier for the REGION, depending on the 'country' (countryCode),
Specifically, only the first digit of four-digit ZIP codes is transferred, and the first two characters of all other ZIP codes.
Configuration:
The screenshot shows the customized configuration for the ZIP code component within the Concatenated projection for the
|
|
Runtime example:
|

