COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: Tyler181 on 06 Feb 2019 10:53:10 AM

Title: Cognos 11 Case Statement headache
Post by: Tyler181 on 06 Feb 2019 10:53:10 AM
Hello All! Grasping at straws here I am not sure why I cant get over this bump.
I have a couple lists that are doing this to me.

I am using several case statements like this
CASE
WHEN ([ITEM 1] = 'VALUE' and [ITEM 2] = 'VALUE')
THEN ([OBJECT])
end

So they're 5 columns like this. I don't want to use an ELSE ('') due to not wanting a blank cell. I am wanting all the data to be in 1 row.

So ideally it should come out as

NAME | ITEM 1 | ITEM 2 | ITEM 3 | ETC | ETC | ETC

However, I instead get

NAME | ITEM 1 | BLANK | BLANK | BLANK | BLANK
NAME | BLANK | ITEM 2 | BLANK | BLANK | BLANK
NAME | BLANK | BLANK | ITEM 3| BLANK | BLANK

I have played with pivoting but it apprently doesn't understand. I have tried row suppression options. I have tried inserting the "ELSE (NULL)" and excluding nulls.
I am just lost.

Anyone able to help on this? I appreciate any assistance.
Title: Re: Cognos 11 Case Statement headache
Post by: Francis aka khayman on 06 Feb 2019 12:37:39 PM
why not use other containers like repeater instead of list?
Title: Re: Cognos 11 Case Statement headache
Post by: dougp on 06 Feb 2019 03:09:05 PM
CASE
  WHEN [ITEM 1] = 'VALUE'
    THEN [OTHER ITEM]
END


...is the same as...
CASE
  WHEN [ITEM 1] = 'VALUE'
    THEN [OTHER ITEM]
  ELSE NULL
END



Based on your desired output, I think you want to aggregate the results.  For example, try changing the Detail aggregation property for that data item to maximum.
Title: Re: Cognos 11 Case Statement headache
Post by: Tyler181 on 07 Feb 2019 06:19:47 AM
Quote
Thank you so
Quote from: dougp on 06 Feb 2019 03:09:05 PM
CASE
  WHEN [ITEM 1] = 'VALUE'
    THEN [OTHER ITEM]
END


...is the same as...
CASE
  WHEN [ITEM 1] = 'VALUE'
    THEN [OTHER ITEM]
  ELSE NULL
END



Based on your desired output, I think you want to aggregate the results.  For example, try changing the Detail aggregation property for that data item to maximum.

Thank you so much. This is exactly it.