COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: jcrouch on 10 Nov 2011 03:40:09 PM

Title: ParamDisplayValue() plus concatenate a string, error
Post by: jcrouch on 10 Nov 2011 03:40:09 PM
Hi all,

I have a simple crosstab report and a prompt value that filters the data. I need one of the crosstab column headers to include the parameter value with a string " Price" after it. I unlocked the report and changed the 'source type' to 'Report Expression'. In the expression I put:

ParamDisplayValue('pVendor')

This works, but I need to add some text after the parameter value. I tried:

ParamDisplayValue('pVendor') || ' Price'

But this gives me an error. It seems any attemp to add text to this fails.

Is there a way to do this?

Thanks,

Jeremy
Title: Re: ParamDisplayValue() plus concatenate a string, error
Post by: cognostechie on 10 Nov 2011 03:51:50 PM
ParamDisplayValue is only for display, not for calculations. That's why it is available in Layout Calculation.

You can put a Text item after it and include 'Price' in that.
Title: Re: ParamDisplayValue() plus concatenate a string, error
Post by: jcrouch on 10 Nov 2011 07:41:05 PM
I did try using a separate text box to put the " Price" after it. But to get it formatted to look like a normal header I had to put them in a 2 column table, that kept them on the same horizontal line. But using the table, when exported to Excel it split the 2 into separate columns. Ill try again tomorrow to fix that.

So there is no way to cast the ParamDisplayValue, or otherwise convert it to useable text?

Thanks again,

Jeremy
Title: Re: ParamDisplayValue() plus concatenate a string, error
Post by: HalfBloodPrince on 10 Nov 2011 10:39:30 PM
Try This

ParamDisplayValue('Parameter_name')+' '+'Price'
Title: Re: ParamDisplayValue() plus concatenate a string, error
Post by: jcrouch on 11 Nov 2011 08:32:35 AM
Quote from: HalfBloodPrince on 10 Nov 2011 10:39:30 PM
Try This

ParamDisplayValue('Parameter_name')+' '+'Price'

;D Worked!

I thought I had tried the plus sign yesterday... Ill add this tip to my ever expanding Cognos Library.

Thanks

Jeremy