COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: pooja on 25 Jan 2010 12:56:28 PM

Title: number-to-string-padded--????
Post by: pooja on 25 Jan 2010 12:56:28 PM

we are upgrading reports from 7.3 to v8 and we are stuck on one
issues which we are not able to overcome. please any advice/solution
would be great.
how to do number-to-string-padded in cognos 8 for BELOW EXAMPLE, please

ex--
number-to-string-padded([dept_code],3)+'_'+ number-to-string-padded([field_code],6)

thankx in advance,
Title: Re: number-to-string-padded--????
Post by: pooja on 25 Jan 2010 02:28:25 PM
Any Help/Response, please
Title: Re: number-to-string-padded--????
Post by: pooja on 25 Jan 2010 04:58:41 PM
 :o :o ???
Title: Re: number-to-string-padded--????
Post by: MFGF on 26 Jan 2010 03:53:02 AM
Hi,

What result are you trying to achieve?  Do you need your result to be nnn_nnnnnn or something else?

If it's the former, try the following:

substring(cast([dept_code]+1000000,char(7)),5,3) + '_' + substring(cast([field_code]+1000000000,char(10)),5,6)

MF.
Title: Re: number-to-string-padded--????---???
Post by: pooja on 26 Jan 2010 09:26:55 AM
still unable

I was not able to explain in details on my last post. But this is the case in 7.3. Now I need to
update this condition in cognos8. anyone, please advice how to achieve in cognos8

(asciiz(round("office_code",0,0),3)) || '-' || (asciiz(round("dept_code",0,0),6)) as CODE

any help kindly appreciate.
Title: Re: number-to-string-padded--????
Post by: MFGF on 27 Jan 2010 02:55:42 AM
As requested before, can you explain exactly what result you are trying to achieve?  We've already had one stab at providing an answer, which appears not to be what you require, so you really need to explain what result you want in order for anyone to be in with a chance of helping you.

MF.