COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: gatorfe on 11 Jun 2013 04:23:01 PM

Title: Filter out 1st Three characters
Post by: gatorfe on 11 Jun 2013 04:23:01 PM
Hello, a user has a report that shows a field called Operation Description.  It has data like 20-Spool, 30-Spool, etc.  They want to filter out any operation description with the word 'Spool'.  How should the syntax look to skip the 1st three characters and just look for the word Spool?  The data is always started with 2 numbers and a dash.  We were thinking something like this [Operation].[Description] not_like "%%%Spool'  Thanks in advance for your suggestions.
Title: Re: Filter out 1st Three characters
Post by: RKMI on 11 Jun 2013 04:46:50 PM
Hi,

Try this,

substr([Operation].[Operation].[Description],3,8)

That should remove the 2 numbers and dash then, you can add to a filter to bring just 'Spool'. This like the ltrim function in Oracle. '3' is the position and '8' last position.

Thanks,
RK