COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Vikram_Mitta on 29 Oct 2008 06:40:54 AM

Title: Invalid Coercion Error !!!!
Post by: Vikram_Mitta on 29 Oct 2008 06:40:54 AM
Hi,

I have a requirement where i need to display set of departments according to the prompt value i select. let me explain my question in detail.

I have a prompt which has a set of values known as Business Units, which are ALL BU, APPS BU,CORPORATE BU, EXCANGE BU...etc.

Now when i select ALL BU i need to get set of Departments which is nested  and I am using a Crosstab for my report.

Let me give the scenario.

I have Sales and Marketing as Functional Hierarchy and have nested a Department, now when i run the report i should be getting a set of Members for that Functional Hierarchy of Sales and Marketing.

Now when i select an BU say ( APPS BU) i should be getting only certain set of departments say BU Service and GAAP, and when i select EXCHANGE BU i need to get only GAAP.

I have written the logic for this but ain't working!!!!



IF ((?Parameter1?) is null) THEN
   (except([Business Unit P&L].[All Cost Centers].[By Department].[Department], [Corp Mkt Dir]) )
ELSE (0)
or

IF ((?Parameter1?) = 'CORPORATE BUSINESS UNIT') then
([Business Unit P&L].[All Cost Centers].[By Department].[Department])
else (0)



The query gets validated but when i slide it besides the Department Hierarchy i get the following error.



QE-DEF-0478 Invalid coercion from 'memberSet' to 'value' for 'if (?Parameter1? is null) then (except(members([Business Unit P&L].[All Cost Centers].[By Department].[Department]),set([Corp Mkt Dir]))) else (0)'.

Can anyone help me in solving this problem.
IF not any alternate solution is also welcomed.

Regards,
Vikram