Formula with two conditions

hello, i need your help with a formula.

The following formula does not yet work 100%.

COUNT (DISTINCT CASE
WHEN “/RWEE/PMCP_TAUFK”.“SLATX” LIKE ‘S -% - S%’ THEN “T_CEL_AT_HP5”. “AUFNR1”
WHEN MATCH_ACTIVITIES (“T_CEL_AT_HP5”. “TXT30”, NODE [‘Outlook: finished message sent’]) = 1 THEN “T_CEL_AT_HP5”. “AUFNR1”
ELSE NULL END)

In my opinion it does not matter in this formula which of the two conditions applies.

I would like to have the formula changed so that both conditions must be met.

What needs to be changed in the formula?

thx

Hi Steven,

in a CASE WHEN, the first condition that is true is taken and the corresponding value in the THEN is returned.
If you have multiple conditions that should be true, you can simply connect them with an AND. In your case, it would look like this:

COUNT (DISTINCT CASE
WHEN "/RWEE/PMCP_TAUFK"."SLATX" LIKE 'S -% - S%' 
AND MATCH_ACTIVITIES ("T_CEL_AT_HP5". "TXT30", NODE ['Outlook: finished message sent']) = 1 
THEN "T_CEL_AT_HP5"."AUFNR1"
ELSE NULL END)

Cheers
David

1 Like

MERCI. it works very nice :slight_smile: