Skip to main content

Is it possible to use the PU_STRING_AGG function as an input to the IN operator?

Here's the snippet I'm trying to get to work:

 

CASE WHEN 

LIPS.POSNR IN ( ' \\'' || PU_STRING_AGG(LIKP, LIPS.UECHA, '\\',\\'' ) || '\\'') 

THEN 'Y' 

ELSE NULL 

END 

 

Not very clear as to how the PU_STRING_AGG handles the values - does it wrap the whole string with an additional set of start/end single quotes? If so - will the single quote delimiter along with a comma turn the string into a list of strings?

Hi Eugene,

 

It is possible to use PU_STRING_AGG as input in an IN operator.

 

I have tried the following code snippet in an OLAP table KPI:

 

CASE WHEN

PU_STRING_AGG ( table, column, '-' ) IN (PU_STRING_AGG ( table, column, '-' ))

THEN 1 ELSE 0 END

 

And it returns successfully 1 for every row.

 

The function operates similar to a CONCAT function, it does not wrap with additional set of single quotes.

I would recommend looking at help.celonis.cloud/help/display/CIBC/PU_STRING_AGG for further reference about how the function works and examples.

 

Hope this helps you with your question.

Best regards

 


Reply