COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: Aspire on 19 Feb 2016 09:19:24 AM

Title: Column calculation applied to all rows with 1 exception
Post by: Aspire on 19 Feb 2016 09:19:24 AM
Hi guys,

I'm using dimensional database and have troubles defining my column expression in order to apply a calculation to all my rows except one which should have another expression formula.
The formula I tried where CASE and IF Statement:

if ([great_outdoors_company].[Products].[Products] = 'Iphone') then formula1 (which is using tuple expression)
else formula2 (tuple expression)

I also tried the caption function: if (caption([great_outdoors_company].[Products].[Products]) = Iphone) then ...

but without any results.

I would like to hear your suggestions!

Thanks
Title: Re: Column calculation applied to all rows with 1 exception
Post by: Aspire on 21 Feb 2016 12:13:00 PM
Hi again,

Can anyone tell me at least how can I make a reference to a specific line in my rows (using dimensional db)?

thanks
Title: Re: Column calculation applied to all rows with 1 exception
Post by: bdbits on 23 Feb 2016 02:01:57 PM
database = dimensionally modeled relational (DMR)?
It might be illuminating to post the expression you are trying to use, rather than the abstract expression you show.
Without any results - Do you get an error message, or just no value displayed? Have you tried just showing the predicates in your expressions as data items, to simplify what is not working.

Row number - if you could calculate it - would almost always be a poor choice. Is there something special about the data on that row? If so, your expression should reference that.
Title: Re: Column calculation applied to all rows with 1 exception
Post by: Aspire on 24 Feb 2016 11:31:22 AM
Thanks for the suggestions bdbids  ;)

It's DMR.

Actually, I succeeded to apply the formula thanks to the caption function with if statement. And then basically I can make a reference to a specific row element via its description through caption.

cheers