COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: adoremars on 04 Oct 2010 06:59:26 AM

Title: ParamValue
Post by: adoremars on 04 Oct 2010 06:59:26 AM
Hi Folks,

I have a query..

I want to show the selected prompt values in the report and the query item selected is from a hierarchy. I used Param value.

Paramvalue('P_Segment')

The output is
Segments: [NS_LaborAnalysis_Dimens].[RD_Segments].[Segment].[Segment]->[all].[BASE]

which displays the whole hierarchy path. But i just require the value BASE which is the param value..
Kindly help me resolve this.
Thanks
Title: Re: ParamValue
Post by: MFGF on 04 Oct 2010 07:23:48 AM
Have you tried using ParamDisplayValue instead?

MF.
Title: Re: ParamValue
Post by: adoremars on 04 Oct 2010 07:46:11 AM
Yes, I have tried both paramvalue and paramdisplayvalue..
Nothing works :(
Title: Re: ParamValue
Post by: CognosPaul on 04 Oct 2010 08:24:42 AM
Try
substring(Paramvalue('P_Segment')
,69
,character_length(Paramvalue('P_Segment'))-69)


The 69 is the number of characters in '[NS_LaborAnalysis_Dimens].[RD_Segments].[Segment].[Segment]->[all].['
Title: Re: ParamValue
Post by: Joe Gilvary on 04 Oct 2010 08:29:24 AM
You say that "nothing works." 

Do you mean that the report itself fails? Or does the report run correctly but you can't display the param value?

Have you checked the param value for null to see if the report receives it correctly?
Title: Re: ParamValue
Post by: cognostechie on 04 Oct 2010 01:48:35 PM
To display the value of the Parameter, use a Layout calculation instead of a Query calculation
Title: Re: ParamValue
Post by: adoremars on 05 Oct 2010 12:01:21 AM
Hi,

The rreport runs fine.. but the paramvalue stuff gets displayed with the whole hierarchy path.

For Eg: The hierarchy query item segment has values like BASE, BASE OUTSOURCE. But what I get is
Segments: [NS_LaborAnalysis_Dimens].[RD_Segments].[Segment].[Segment]->[all].[BASE]

Let me try with your option and see what happens..

Many thanks..
Title: Re: ParamValue
Post by: adoremars on 05 Oct 2010 12:24:30 AM
Hi Paul,


substring(Paramvalue('P_Segment')
,69
,character_length(Paramvalue('P_Segment'))-69)

This works only for single value selection and does'nt work for multiple value selection right?

I have used Layout calculation FYI..

Still I face the same issue :(

Any ideas?

Many thanks..
Title: Re: ParamValue
Post by: IceTea on 05 Oct 2010 01:34:38 AM
Hm. What is your data source? Just tried it with a powercube...

ParamValue give the MUN like   "[Krankenhaus Cube].[Dim Krankenhaus].[Dim Krankenhaus].[Krankenhaus Land]->:[PC].[@MEMBER].[Baden-Württemberg]"

ParamDisplayValue gives the displayed value like    "Baden-Württemberg"

So this works. Maybe you can play around with a new field based on the Caption() command.
Title: Re: ParamValue
Post by: adoremars on 05 Oct 2010 01:50:48 AM
Hi,

The datasource is a FM Package which connects to Oracle..

Can you brief me once again.. I mean about the Caption() command..

I also used Paramdisplayvalue(). but not getting the end value rather getting whole path.

many thanks..
Title: Re: ParamValue
Post by: IceTea on 05 Oct 2010 03:01:56 AM
QuoteError description
      When a report which contains prompts (ie  tree prompts)  which
      have default selections, ParamDisplayValue  will display the
      MUN, rather than the actual value.
      ( ie member caption)

Local fix

Problem summary

      ****************************************************************
      * USERS AFFECTED:                                              *
      * All Users                                                    *
      ****************************************************************
      * PROBLEM DESCRIPTION:                                         *
      * See error description.                                       *
      ****************************************************************
      * RECOMMENDATION:                                              *
      * Upgrade to IBM Cognos 8 Business Intelligence 8.4.1 FP2      *
      ****************************************************************


This is what mother IBM says to your problem ;)

For a workaround... you could add (if not added yet) the corresponding field to your query and use this in a small extra list on your report to reflect the selected prompt value. If this is always only ONE item (as your prompt accepts only single parameter) you can do this within a singleton.

If using this field also throws out a MUN, you can here do a caption([fieldname]) in your query which does the thing you want. I hope.
Title: Re: ParamValue
Post by: adoremars on 05 Oct 2010 04:29:59 AM
I would need both single selection as well as for mutiple selection. Will caption command works for multiple selection? still cud'nt resolve it..

thanks...
Title: Re: ParamValue
Post by: adoremars on 05 Oct 2010 04:46:53 AM
Using singleton query item its working fine.. but is there a way to make it work for multiple selections as well?

many thanks..
Title: Re: ParamValue
Post by: IceTea on 05 Oct 2010 06:20:28 AM
As i know -> for multiple selection a Singleton is not the right choice. I would solve this - as described - with a small list.

I'm sure there are other, smoother solutions. Come on folks! ;)
Title: Re: ParamValue
Post by: CognosPaul on 07 Oct 2010 04:21:57 AM
Well, instead of a list I'd use a repeater. That would let the values go across the screen, instead of down and taking up lots of room.

So basically you'd have a query that is essentially:

set(#promptmany('P_Segment','memberuniquename')#)

You'd stick that data item into the repeater. Before the data item you'd put a text item with ', ', with a render variable RowNumber()<>1.

That way you could get seg1, seg2, seg3, seg4, etc.
Title: Re: ParamValue
Post by: IceTea on 07 Oct 2010 06:51:32 AM
Quote from: PaulM on 07 Oct 2010 04:21:57 AM
You'd stick that data item into the repeater. Before the data item you'd put a text item with ', ', with a render variable RowNumber()<>1.

That way you could get seg1, seg2, seg3, seg4, etc.

*thumbsup*