Using OR in a Formula

I need help with a formula.

COUNT (DISTINCT CASE WHEN “EBAN”. “LOEKZ” = ‘X’ THEN “EBAN”. “BANFN” ELSE NULL END)
OR
COUNT (DISTINCT CASE WHEN “EBAN”. “BSMNG”! = 0 THEN “EBAN”. “BANFN” ELSE NULL END)
OR
COUNT (DISTINCT CASE WHEN MATCH_ACTIVITIES (NODE [‘Banf ist erledigt’]) = 1 THEN “EBAN”. “BANFN” ELSE NULL END)

Here I would like to make a case distinction.
The formula doesn’t work that way. There is an error.

I want to count my requisition
if either

  1. LOEKZ = X
    OR
    if 2. BSMNG is not equal to 0
    OR
    if the activity “Banf ist erledigt” is in the activity table.

It is only important that the BANF is counted only once.
That means that the BANF should have all 3 characteristics, so only 1 should be counted and not 3.
I hope I can get this through DISTINCT.

Thanks

Hi,

have you tried to use

COUNT(DISTINCT
CASE WHEN  “EBAN”. “LOEKZ” = ‘X’ THEN “EBAN”. “BANFN”
WHEN “EBAN”. “BSMNG”! = 0 THEN “EBAN”. “BANFN” 
WHEN MATCH_ACTIVITIES (NODE [‘Banf ist erledigt’]) = 1 THEN “EBAN”.“BANFN” 
ELSE NULL END)

Once a PR has one of the conditions, the case when statement will return 1 count, whether it has all 3 or just 1 condition.

Best regards,
Viana