COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Framework Manager => Topic started by: srinu1253 on 01 Jun 2014 06:53:22 PM

Title: BMT-MD-2047 Cannot assign the "_memberCaption" role to this query item
Post by: srinu1253 on 01 Jun 2014 06:53:22 PM
Hi,

I am getting this error in Cognos Framework Manager. In DMR for Time dimension getting this error for Year.

BMT-MD-2047 Cannot assign the "_memberCaption" role to this query item because its data type is not "string". Either change the query item expression to be of type "string" or create a new string calculated item and assign the role to it.

I tried Casting function Cast([Modelling Layer].[Time].[Year Count],varchar(4)) and to_char function to_char([Modelling Layer].[Time].[Year Count]). But no use.

Any Help would be appreciated.
Title: Re: BMT-MD-2047 Cannot assign the "_memberCaption" role to this query item
Post by: Francis aka khayman on 02 Jun 2014 09:23:05 PM
Year Count is your year? Anyway why don't you cast the Year that you use as business key?
Title: Re: BMT-MD-2047 Cannot assign the "_memberCaption" role to this query item
Post by: srinu1253 on 04 Sep 2014 03:31:08 PM
Thanks for Respose. Yes Year Count is Year.
Title: Re: BMT-MD-2047 Cannot assign the "_memberCaption" role to this query item
Post by: srinu1253 on 04 Sep 2014 03:33:04 PM
Tried the method which you have saif but Its not working. The Year Count's Datatype in the database is Integer.I am trying to create a DMR having Year in the top most hierarchy(with business key and member Caption).But I am getting the above error.
Title: Re: BMT-MD-2047 Cannot assign the "_memberCaption" role to this query item
Post by: Francis aka khayman on 04 Sep 2014 08:53:48 PM
you are getting the above error because your Year is an integer and caption needs a string. convert the integer into a string and the above error will disappear.

now, you said you tried to cast to string "but no use". what does that mean? does it mean you cast to string but there is still an error (unlikely), or you were not able to cast? if so what is the error?
Title: Re: BMT-MD-2047 Cannot assign the "_memberCaption" role to this query item
Post by: bus_pass_man on 04 Sep 2014 09:30:47 PM
Yeah more detail about the observed behaviour would be useful.   When you test the expression, what do you see?   

What is the size of the year count column?   It's possible that you ought to try to increase the size of the varchar.   When you specify the varchar size as 4 you're saying that the largest value in your column is 4 digits.   Sometimes when I've specified too small a size I get results like blanks and truncated values.
Title: Re: BMT-MD-2047 Cannot assign the "_memberCaption" role to this query item
Post by: MFGF on 05 Sep 2014 03:42:58 AM
Can you be specific about what exact item you are using for your ID and your caption? You refer to both Year and Year Count. Are you casting one and using the other? Where are you doing the casting - in an expression in the regular dimension or elsewhere?

MF.