COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: roms.cognoise on 30 Jan 2012 09:38:04 PM

Title: Help: Text Box Prompt range
Post by: roms.cognoise on 30 Jan 2012 09:38:04 PM
Hi, good day to you all.
Im just wondering if u guys can help me with my very first project in cognos.

I have a TEXT BOX Prompt that the range property is set to YES, which will display 2 text box for the inrange value. My question is how do I get the value of the 1st textbox separated from the 2nd text box. because when i use paramValue('TextBox') the value be shown as "value1 to value2". I hope to get only value1.

Any help and insight will do.. thanks.
Title: Re: Help: Text Box Prompt range
Post by: tjohnson3050 on 30 Jan 2012 09:45:16 PM
Use two text box prompts.  In your filter use between instead of in_range.
Title: Re: Help: Text Box Prompt range
Post by: roms.cognoise on 30 Jan 2012 10:02:26 PM
Thanks for the reply johnson. but thats not the answer im looking for.

I only have 1 Text box prompt that the RANGE PROPERTY is set to yes. and because range property is set to yes it will display 2 text box instead of one. The only thing i wanna know here is how do I get the value that I wrote on those text box to be separated? Because when I use paramValue('TextBox') , It will get the value of both textbox.
Title: Re: Help: Text Box Prompt range
Post by: tjohnson3050 on 31 Jan 2012 12:22:28 PM
I was thinking it would be easier to do this as two separate prompts, because that would separate the two parameter values, but if you have a hard requirement of using only the one prompt, you need to take the one parameter value and separate out the first one using report functions.  If your parameter value is returning 'Between x and y' then to return just 'x' you would use something like:

substring(ParamDisplayValue('Parameter1'),9,position(' ',substring(ParamDisplayValue('Parameter1'),9,character_length(ParamDisplayValue('Parameter1'))-9)))
Title: Re: Help: Text Box Prompt range
Post by: roms.cognoise on 01 Feb 2012 09:10:31 PM
So it really means that their is no specific command to separate those two values. Thanks johnson. This function will do. Appreciate the help.