@henning.gertz can you share the image again ?
Hi @henning.gertz,
How are the tables linked to each other, regarding 1 to many relations?
For example:
VBEP - N:1 - VBAP - 1:N - MARA - 1:N - MVKE
This will help to understand how to setup the Pull Up functions.
Hi @henning.gertz
the issue lies in the VBAP - MARA - MVKE relation, being in the format N:1:N. Here, a certain entry on the N side of the VBAP table does not know to which entry on the N side of the MVKE table it should be linked.
This can be solved by using a Pull Up function. Using an aggregation, you specify which single row (e.g. First/Last/Max/Min) from the MVKE table to link to the MARA table, and your connection therefore becomes N:1:1.
You can find all the details of the Pull Up (PU) functions on the Celonis Docs: https://docs.celonis.com/en/pull-up-aggregation.html
In your situation, if you want to keep the latest MVGR1 value (based on LDVFL) from the MVKE table, your code would be:
PU_LAST( “MARA” , “MVKE”.”MVGR1”, ORDER BY “MVKE”.”LDVFL” ASC)
I hope this helps!
@janpeter.van.d
thank you very much for your support!
I tried to use PU function before. Using PU_FIRST or PU_LAST the column always shows the same value for all articles and sales organizations. But this is not correct.
“MVKE”.”MVGR1 is dependent from the sales org. An article no. in the MARA can have a different “MVKE”.”MVGR1 based on the Sales org. (VBAK.VKORG)
VBAK - VBAP 1:n
@henning.gertz
In that case, I think it will be better if you include VKORG and VTWEG from VBAK to VBAP at transformation level and then link the MVKE table directly to VBAP using MANDT, MATNR, VTWEG, VKORG - these 4 columns as these are the primary keys in MVKE.
MVKE - VBAP - 1:N
@dxb.miner Thanks for this hint.
I will try to check out this solution.
At the moment MVKE is connected to MARA and MARA is connected to VBAP. Trying to connect MVKE directly to VBAP I guess this will create duplicates.
@henning.gertz
Please link MVKE and VBAP at the data model level using the MANDT, MATNR, VTWEG, VKORG which are primary keys in MVKE. It should create a 1:N relation from MVKE to VBAP. Duplicate should not occur.