COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: lebronjames on 09 Feb 2009 03:34:17 PM

Title: Substring for Cube members
Post by: lebronjames on 09 Feb 2009 03:34:17 PM
Hi,
I am making a report using a cube. I have a string field that I want to cut a little bit to make it fit better.

Usually i would just go to the Data Item expression editor and use the substring function.

But with cube members, I cannot see this option. Please help.

Thanks.
Title: Re: Substring for Cube members
Post by: rockytopmark on 12 Feb 2009 10:40:16 AM
If you have attributes of the level available (from a cube, you should have label, short desc, description, to name a few... these are strings and you can probably leverage the substring function on those.  If you use Members, Hierarhcies or Levels, you are not dealing with strings.
Title: Re: Substring for Cube members
Post by: lebronjames on 13 Feb 2009 01:35:16 PM
Thats good info Rocky. I am using members.

Is there any way to concatenate those??
Title: Re: Substring for Cube members
Post by: Gollapudi on 02 Mar 2009 11:32:59 PM
Hi,

If you wanna use substring with Cube members you should use "Caption" function along.

Ex: substring(caption([great_outdoors_company].[Products].[Products].[Product line]),1,2)

Thanks,
Venu.
Title: Re: Substring for Cube members
Post by: jhilley on 03 Apr 2009 08:08:23 AM
if I use Caption([Account]) then the query runs in 2 sec.
when I add substring(caption([Account]),1,5) then the query either does not run or takes forever to run.... any ideas?

[Account] is a level in the Chart Hierarchy
Thanks
Title: Re: Substring for Cube members
Post by: billylodz on 03 Apr 2009 08:52:40 AM
for Level Account you should have Account - Long Name, it's string