COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Little Princess on 02 Apr 2009 12:41:43 PM

Title: The query specification is incorrect
Post by: Little Princess on 02 Apr 2009 12:41:43 PM
Hello experts,

I have very simple condition to bring amount from two different fields into one column in the report and very simple if statement to do it:

if ([Presentation View].[ConsolidatedTransactions].[transactionType] = 'Associated Payment'
and [Presentation View].[ConsolidatedTransactions].[DetailpaymentTypeCode] = 'AMOUNT' )
then ([Presentation View].[ConsolidatedTransactions].[PaymentAmount])
else ([Presentation View].[ConsolidatedTransactions].[MiscExpenseAmount])


And this is the error I get:

RQP-DEF-0149 The query specification is incorrect.
RQP-DEF-0217 Wrong expression type: if ([Presentation View].[ConsolidatedTransactions].[transactionType] = 'Associated Payment'
and [Presentation View].[ConsolidatedTransactions].[DetailpaymentTypeCode] = 'AMOUNT' )
then ([Presentation View].[ConsolidatedTransactions].[PaymentAmount])
else ([Presentation View].[ConsolidatedTransactions].[MiscExpenseAmount]).


What does it mean? Where did I make a mistake?

I appreciate any help
LP
Title: Re: The query specification is incorrect
Post by: vij on 03 Apr 2009 01:27:34 AM
Hi Little Princess ,

please check the datatyape for
[Presentation View].[ConsolidatedTransactions].[transactionType]  and [Presentation View].[ConsolidatedTransactions].[DetailpaymentTypeCode] in framework manager.

if they are except integer then put the (' ') single quote around the values
else do not put the (' ').

hope it might be useful for you


vij
:)
Title: Re: The query specification is incorrect
Post by: CognosSupport on 03 Apr 2009 01:49:19 AM
Hi LP,

Also try if using the caption() function works for you.

CS