Case Statement Issue ???

Hi Bobers ,

There is problem in one of our grouping object( P group ) . According to Business Requirement the definition of grouping object :

Pgroup =

CASE

    WHEN P_CD IN ('05','73','74','81','82') THEN 'FYR'

    WHEN P_CD IN ('08') THEN 'LTG'

WHEN P_CD IN ('07','77','78','15','61','62') THEN 'WTR'
    
WHEN P_CD IN ('16','75','76') THEN 'AR'

WHEN P_CD IN ('26','45','60') THEN 'AP'

WHEN PCD IN ('05','08','10','73','74','81','82') THEN 'FYR & LTG'

    ELSE 'OTHER'  

END

Now the problem is that the same P_CD mark in red are getting gropued in various gp , so Business Objects will only show the grp in the fisrt grp they appear . For eg PCD 08 appear in FYE and FYR a& LTG .

Has any one faced this problem and how they resolved the same .

Regards
Sapan


swapnil_taz :india: (BOB member since 2006-04-06)

Are you saying that PCD of 08 needs to result in 2 groupings being shown?


Michael Abelha :australia: (BOB member since 2002-08-16)

Hi ,

Yes I want that The repeated code values shld be there in all the groupings .

Regards
Sapan


swapnil_taz :india: (BOB member since 2006-04-06)

I though a case statement would only return 1 value, not multiple values.

If you want PCD 08 to return “LTG, FYR and LTG” then you could have a line in the case statement that returns just that. You would then remove PCD 08 frm the other parts of the case statement.

Regards.


Michael Abelha :australia: (BOB member since 2002-08-16)

You are correct about the CASE statement returning only one value, and it will be the value of the first WHEN condition that is met.


bgray :us: (BOB member since 2005-06-22)