COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: venkiatmaruthi on 25 Feb 2011 12:40:53 AM

Title: [Resolved] Invalid Coercion error
Post by: venkiatmaruthi on 25 Feb 2011 12:40:53 AM
Hi

I have one report having a Cross tab. Inside a cross tab I have chart.
I have a query item DOTRED having the expresion as Head(DATE) where DATE is a another query item from same Query.

When I keep DOTRED in the Chart series list, I am getting the following error.

QuoteInvalid coercion from 'value' to 'memberSet' for '[DATE]' in 'Head([DATE])'.

Please help me.
Title: Re: Invalid Coercion error
Post by: PRIT AMRIT on 25 Feb 2011 02:23:39 AM
can you please elaborate your issue and what you want to achieve?
Title: Re: Invalid Coercion error
Post by: venkiatmaruthi on 25 Feb 2011 05:38:16 AM
Actually I am doing the upgrading a report from 8.2 to 8.4.1.

I am getting the following error due to the column in query.

QuoteInvalid coercion from 'value' to 'memberSet' for '[DATE]' in 'Head([DATE])'.

In 8.2, it's working fine.

Column having the expresion --> Head([DATE])
Head function is giving the error.
Title: Re: Invalid Coercion error
Post by: MFGF on 25 Feb 2011 11:58:36 AM
Hi,

The syntax checking has been tightened up considerably since 8.2. The real issue is that the expression is not legal and should never have worked in the first instance.

To use a head() function, your [Date] item needs to contain a set of members, and currently it contains a value - hence the error. I'd guess that [Date] is itself a calculated item? If so, what expression is being used to derive it?

Your best bet will be to modify this expression to return a valid set. One option could be to use a member() function within a set() function, but without knowing how Date is currently derived, it's hard to provide an appropriate solution.

Regards,

MF.
Title: Re: Invalid Coercion error
Post by: venkiatmaruthi on 28 Feb 2011 03:46:59 AM
Thanks MF.

Member and set functions are not working here. I tried already.
Here I am using Relational model. Date is a normal data item in query. There is no hierarchy involved in it.

I am using this DOTRED query item contains expression Head(Date) in combination chart as one series.

In 8.2, it's working fine and giving DOTRED column as value 1 and returning only first row of all records for that query.



Thanks.
Title: Re: [Resolved] Invalid Coercion error
Post by: venkiatmaruthi on 28 Feb 2011 08:04:38 AM
Hi,

Resolved the issue. Looks simple but don't know how it worked. earlier also  I tried the same but didn't work. now working fine.

here Head(Date)  where Date is the column from same query [Query2].
Actual Date column is coming from other query. [Query1].[Date]

So I replaced Head(Date) with Head([Query1].[Date])

working with a warning: property to memberset.