COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Nandini.t on 30 Nov 2011 03:45:40 AM

Title: multiplying coulumn content by manually entered number in prompt parameter
Post by: Nandini.t on 30 Nov 2011 03:45:40 AM
Hi.

i have to multiply a clolumn content(number) by the the percentage value manually entered in the text box prompt parameter. if nothing is entered in the parameter then by default the column must be multiplied by '0.0005%'.
guide me hw can i write the condition.
Title: Re: multiplying coulumn content by manually entered number in prompt parameter
Post by: HalfBloodPrince on 30 Nov 2011 04:18:10 AM
Hi,
Try this  calculation ([Number] * cast(?Parameter2?,float)). and set default value of ur prompt to 0.005 but using parameter in calculation wil make the prompt required, forcing you to enter the value.
Title: Re: multiplying coulumn content by manually entered number in prompt parameter
Post by: blom0344 on 30 Nov 2011 04:23:46 AM
case
when
?some_parameter? is null
then [somevalue]*0.000005
else [somevalue]*cast(?some_parameter?,float)
end
Title: Re: multiplying coulumn content by manually entered number in prompt parameter
Post by: Nandini.t on 30 Nov 2011 04:43:34 AM
thanks.

I will try both the methods.
Title: Re: multiplying coulumn content by manually entered number in prompt parameter
Post by: Lynn on 30 Nov 2011 01:42:08 PM
I'm pretty sure that if you reference a parameter in a data item expression it will be required no matter how much you beg and plead....and therefore can't ever be null.....you will always have to enter something.

Could you just set the default value for your text box prompt to 0.000005?