Skip to main content

PQL47 (PQL Function Library - CPM 4.7)

BIND

Applies to: CELONIS 4.7

Description

BIND pulls a column to a specified table. This requires that the owner table of the column is a direct or indirect dimensional table w.r.t. the specified table.

Syntax
BIND( target_table, source_table.column)
Usage in PU functions

BIND introduces the join between the specified source table column and the target table. This can be helpful in PU functions, for example, where it enables to aggregate from the source table column to the child table in a 1:N:1 relationship:

34440255.png

In order to aggregate from the source table to the child table, we first need to bind the source table column to the parent table using BIND. The resulting column can then be aggregated to the child table using a PU function.

If the target_table is the owner of column, column is returned unmodified.

Examples

[1] 1:n relationship between caseTable and OrderPos, 1:n relationship between productTable and OrderPos. We want to find the price of the most expensive product in an order (case). PU_MAX cannot pull directly from the productTable to the caseTable, so we use BIND to pull the price column to the OrderPos table.

Query

Column1

"caseTable"."caseName"

Column2

PU_MAX ( "caseTable" , BIND ( "OrderPos" , "productTable"."price" ) )

Input

Output

OrderPos

caseId : INT

productID : INT

1

1

1

2

2

2

2

3

3

1

caseTable

productID : INT

caseName : STRING

1

'Case 1'

2

'Case 2'

3

'Case 3'

productTable

productID : INT

productName : STRING

price : FLOAT

1

'Product A'

4.0

2

'Product B'

7.0

3

'Product C'

20.0

Foreign Keys

OrderPos.productID

productTable.productID

caseTable.caseId

OrderPos.caseId

Result

Column1 : STRING

Column2 : FLOAT

'Case 1'

7.0

'Case 2'

20.0

'Case 3'

4.0

Query

See also: