Skip to main content
Hi,
Can anyone help me with the pql code to BIND to connect the Eventime of the creation of a purchase order and the release date of a requisiton?
I don´t get the logic of BIND yet

Hi Jesus,

 

This is an aggregation level PQL query.

BIND is used whenever you want to pull a column from another table into a specified table (TARGET TABLE). Typically, the table containing the column and the target table must have a direct or indirect 1:N

relationship.

 

Example

  1. Relationship (EKKO:EKPO)-->1:N
  • Query: Get Creation date of a purchase order item for each purchase order.
  • PQL: BIND("EKPO", "EKKO"."AEDAT")
  • Explanation:

We used BIND to get from the purchase order level to the purchase order item level, meaning we have pulled the purchase order creation date for each purchase order item.

 

For more examples, check here.

 

I hope this makes sense. Let me know if you have any further questions!

 

 

 

 


Hi Modester,

 

Thank you for your response, it helped me understand.

Could you please explain me how to use BIND in a PU FUNCTION?


Hi Jesus,

 

When working with BIND it introduces an intermediate table join between specified source table and target table. The BIND can be helpful in PU function when working with relationship tables that have a 1:N:1.

 

Example:

The table below shows a typical example of how BIND can be useful in PU functions.

We see that for us to aggreagte froma. source tabe to a target table we need to first bind the source table column to an intermidiate using BIND. The resulting column can be aggregated to the target table using a PU-function.

Screenshot 2024-08-07 at 11.55.41 

Query Example: CaseTable-->OrderPos have a 1:N and productTable-->OrderPos have a 1:N. We want the price of most expensive product in an order(case). If we were to show this relationship in a diagram it would look as the image below and the relationship as 1:N:1

 

Screenshot 2024-08-07 at 12.13.49 

Solution: To solve this, we cannot use PU-function to directly pull from product table to caseTable since they don't have a direct 1:N relationship. you will therefore have to use BIND to pull the price to OrderPos table.

 

  • Bring the price column to Order Pos level: BIND ( "OrderPos" , "productTable"."price" )
  • then pull price from order pos level to casetable level: PU_MAX ( "caseTable" , BIND ( "OrderPos" , "productTable"."price" ) )

 

Trick: use BIND when pulling from 1 side to N side and use PU-function to pull from N side to 1 side

I hope this helps!

 

 


Thanks, that is very helpful!


Reply