Skip to main content

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 doesnt work that way. There is an error.

I want to count my requisition

if either

  1. LOEKZ = X
  2. OR
  3. if 2. BSMNG is not equal to 0
  4. OR
  5. 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

Reply