Skip to main content
Question

Formula with two conditions

  • September 23, 2020
  • 3 replies
  • 2 views

steven.bernd
Level 6
Forum|alt.badge.img+1

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

3 replies

Forum|alt.badge.img+2
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

steven.bernd
Level 6
Forum|alt.badge.img+1
  • Author
  • Level 6
  • September 24, 2020
MERCI. it works very nice

  • Level 0
  • November 27, 2021

The opposite of the AND operator would be the OR operator. This allows you to create a statement where one OR the other condition needs to be met for the statement to be true. Just in case you have multiple conditions that all result in the same output. Just for completeness :)

 

Best

Kevin