Skip to main content
Hi all, How can I retrieve the second values from a source column. I want the second LINK from the PU_FIRST("MARC","PICTURES"."LINK")

just a guess i am not sure if this logic works.

try with a case when PU_FIRST("MARC","PICTURES"."LINK") != MAX(PU_FIRST("MARC","PICTURES"."LINK")) THEN PU_FIRST("MARC","PICTURES"."LINK") ELSE NULL END


This seems like a perfect use case for the INDEX_ORDER function. Despite being new to Celonis and not too familiar with this function, I tried something similiar for a date-column right now and it worked:

 

Basically in this case using a PU_Function something like this:

 

PU_FIRST (

 "MARC" ,

 "PICTURES"."LINK",

 INDEX_ORDER ( "PICTURES"."LINK" , ORDER BY ( "PICTURES"."LINK" DESC ) , PARTITION BY ( "MARC"."MATNR" ) ) = 2

)

 

This worked for my Test-Use with other data and table columns obviously. Not sure what the "pictures"."link" is, but I assume it is a value for each Material in MARC?

 

INDEX_ORDER gives each "pictures"."link" an integer from 1 to X for each Material (Partition) in a descending order. In this case, I filter to only show me the second index, aka the second entry.

You might have to change what your ORDER BY since i dont know what your goal the "picture"."link" is and it what order you want the second entry.

 

Let me know if it works. Otherwise I´d recomment looking up INDEX_ORDER in the documentation, this seems like the right function for this use case.

 


Reply