COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: learnflower on 14 Dec 2011 06:33:12 AM

Title: Report expression
Post by: learnflower on 14 Dec 2011 06:33:12 AM
Hi ,
I want to display the Line of business according to the product code in a Report Expression

Please help me on this
eg : Depending of the Policy product:
= 'MARINE' for policy product equal to MAR
= 'CORPORATE' if policy product in (GP,RP,SP,AP,YP)
= 'AVIATION' policy product in (IP,CP)
Title: Re: Report expression
Post by: Gyana.Sahoo on 14 Dec 2011 07:37:36 AM
Is it like to Use Case Statement ??????????

Correct me......
Title: Re: Report expression
Post by: MFGF on 14 Dec 2011 08:34:25 AM
Quote from: Divya S on 14 Dec 2011 06:33:12 AM
Hi ,
I want to display the Line of business according to the product code in a Report Expression

Please help me on this
eg : Depending of the Policy product:
= 'MARINE' for policy product equal to MAR
= 'CORPORATE' if policy product in (GP,RP,SP,AP,YP)
= 'AVIATION' policy product in (IP,CP)

if ([policy product] = 'MAR') then ('MARINE') else
if ([policy product] in ('GP','RP','SP','AP','YP')) then ('CORPORATE') else
if ([policy product] in ('IP','CP')) then ('AVIATION') else
('OTHER')

MF.
Title: Re: Report expression
Post by: learnflower on 15 Dec 2011 12:38:00 AM
Thanks MFGF ,

But i am getting error for this if condition , the error is RSV-VAL-0002 Invalid expression and also CRX-YXX-4010 Parsing error on or around position 49 in the expression as i am taking product code from the query.

Please guide me on this
Title: Re: Report expression
Post by: blom0344 on 15 Dec 2011 01:08:17 AM
Report expressions work within the local context of a report. You can reference parameter values etc, but not query items. You can use the logic provided and use it in a datacontainer.

Why are you trying to write a report expression based on fetched data anyway?  Unless you fetch just one row, you will always have a set returned (to be displayed)