COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Ricky@MDPD on 10 Mar 2009 08:47:01 AM

Title: MDX equivelent of 'starts with'
Post by: Ricky@MDPD on 10 Mar 2009 08:47:01 AM
I need to filter my results to display values that starts with 'AG%'

how do I do this in MDX...? my reports is based on a cube.

Any help is greatly aprciated.

Title: Re: MDX equivelent of 'starts with'
Post by: Gollapudi on 11 Mar 2009 06:21:30 AM
Hi,

therez a built in "substring" function available in cognos, try to retrieve first 2 letters of the data item and compare with "AG", but do remember that you should put the expression in Caption before you substring it, otherwise Cube Datasource packages will now allow you to use "substring".

Ex: substring(caption([Great_Outdoors_Company].[Products].[Products].[Products]),1,2)='AG'

Thanks,
Gollapudi.