If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Error in Converting a lableLevel using CAST function - Cognos DMR

Started by jasmina, 13 Nov 2014 06:31:07 AM

Previous topic - Next topic

jasmina

Hi,

We have created date item and put the following expression to get the level value from hierarchy for each level.

Data Item 1:  roleValue('_levelLabel',[HIER ALL])

This is working fine but I need to append this value with string value so I am trying to convert using CAST function but it raising an error.

We are trying to achieve : 'TEST MESSAGE'+ CAST(roleValue('_levelLabel',[HIER ALL]),VARCHAR(50)).

Although we have used similar expression to get the member caption with CAST and it is working as expected. -->  'TEST MESSAGE'+ CAST(roleValue('_memberCaption',[HIER ALL]),VARCHAR(50))

Please let me know if you have any idea about solution.

Thanks.



Francis aka khayman

you have a second expression that is working as expected. may i ask why not use it instead?

navissar

Quote from: jasmina on 13 Nov 2014 06:31:07 AM

This is working fine but I need to append this value with string value so I am trying to convert using CAST function but it raising an error.

It's usually a lot easier to help when we know what the error is... :)
Anyway, you don't need to cast it - level label is already a string. You also don't need to cast member caption.

jasmina

Hi,

We need current member and it immediate parent value at same hierarchical level, which will be used  as input parameter in generating URL to launch third party application.

So CAST(roleValue('_memberCaption',[Level 1]),VARCHAR(50)) will give me the current value of the member and CAST(roleValue('_levelLabel',[HIER ALL]),VARCHAR(50)) will give the immediate parent but the real issue is arise when we tried append to other static string value while generating URL.

is you try to append roleValue('_memberCaption',[Level 1]) with any string then it won't work and will give an error. Try Data Item 1: roleValue('_memberCaption',[Level 1])||' - '||'TEST MESSAGE' .

Hope you have clear understating of what we are trying to achieve.

Thanks

navissar

Quote from: jasmina on 17 Nov 2014 04:32:57 AM


is you try to append roleValue('_memberCaption',[Level 1]) with any string then it won't work and will give an error. Try Data Item 1: roleValue('_memberCaption',[Level 1])||' - '||'TEST MESSAGE' .

...
What. is. the. error?

jasmina

Hi,

XQE-GEN-0002 : An unexpected exception occurred: com.cognos.xqe.runtree.olap.mdx.dmrprovider.DMRMemberProxy incompatible with com.cognos.xqe.data.values.Value

This Type Of Error i get.