Skip to main content

Hello everyone,

 

we have an analysis sheet that we export as a pdf via action flow. In this sheet we normally filter on a specific plant number before exporting. We want to add the plant description in the analysis as a text field, but only if just cases of one plant are selected. When there are multiple plants selected, the text field should show "Multiple plants selected".

 

I have tried to create a formula and add the result in the text field:

 

CASE

WHEN COUNT(DISTINCT "AUFK"."WERKS") > 1 THEN 'Multiple plants selected''

ELSE "AUFK"."WERKS_TEXT"

END

 

This throws an error as I am mixing aggregate and case based info. I have also tried to add a PU_FIRST to the ELSE statement, but this does not help.

 

Is there a way, how this can be done? Thank you for your help.

Hi Philipp ,

Did you try using PU_COUNT ?

 

Regards

Ayan


Bind the table with domain_table(..) together with the original table in a PU-Function (maybe PU-COUNT).. and than you can use the normal cases u've mentioned


Thank you for the hints. I have solved it using MODE().

 

CASE

WHEN COUNT(DISTINCT „AUFK“.“WERKS“) > 1 THEN ‚Multiple plants selected‘

ELSE MODE(„AUFK“.“WERKS“)

END


Reply