COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: gagnonp on 05 Feb 2014 03:18:51 PM

Title: [RESOLVED] How to use the LEFT function against a cube member
Post by: gagnonp on 05 Feb 2014 03:18:51 PM
I want to use the left function in a dimensional report studio query.

For example:  left([great_outdoors_sales_en].[Currency].[Currency].[Member Description], 2)

Returns: RQP-DEF-0177 An error occurred while performing operation 'sqlPrepareWithOptions' status='-126'.

I tried to use left function in conjuction with the caption function, the rolevalue function. No luck...
Title: Re: How to use the LEFT function against a cube member
Post by: MFGF on 06 Feb 2014 04:34:54 AM
Hi,

In what context are you trying to use the result?  Is there any more to the error returned? Generally the message you posted is followed by a more detailed error? What are you trying to do in your report?

MF.
Title: Re: How to use the LEFT function against a cube member
Post by: gagnonp on 06 Feb 2014 08:06:35 AM
Beep Beep!

Here's the context: Return the 2 first characters of a cube member into a data item:

1. Open report studio with great_outdoors_sales_en package (cube)
2. Create a new list report
3. open query1 in query explorer
4. from the toolbox, drag a data item and paste: left([great_outdoors_sales_en].[Currency].[Currency].[Member Description], 2)
5. Click run, view tabular data.


Title: Re: How to use the LEFT function against a cube member
Post by: MFGF on 06 Feb 2014 10:39:36 AM
substring([great_outdoors_sales_en].[Currency].[Currency].[Member Description],1,2)

Works fine for me...
Title: Re: How to use the LEFT function against a cube member
Post by: gagnonp on 06 Feb 2014 11:00:27 AM
Thank you so much for your time.

I realize now that SUBSTRING function is under Common Functions, LEFT is under Vendor specific.  When using a cube as a data source, the vendor specific functions are not working.

Case closed!