COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: CVR on 16 Oct 2008 06:18:49 AM

Title: How to extract number part from a string field
Post by: CVR on 16 Oct 2008 06:18:49 AM
Folks,
I need some here here.... I have one data column 'help_info" containing values like "Loan no: 12345", "Loan no:23456 part payment"

Now, I have to get the number part from these fields into separate field and display it.

I can get the number parts using java script, but in cognos 8.3 I don't know how to populate a field with output of java script.

(or)
is there a direct way (function call) to get number part from a string part so that I can apply it and get required info from data item itself..

Thanks in advance for any sort of help here.
Title: Re: How to extract number part from a string field
Post by: Gopinath on 16 Oct 2008 06:58:33 AM
Try some logics using functions like Position(), Substring(), and Trim()
Title: Re: How to extract number part from a string field
Post by: CVR on 16 Oct 2008 07:01:51 AM
All these functions need static text ... I need to find numbers like '%[0-9]%'  (pattern) in the string and extract them out...

Thanks.