Hi All,
Is there any way to check whether a value is selected in a
Multi-select tree prompt? I have a tree prompt and want to
get to know whetehr which values user has selected,i want
to so that values on the top of the report.

I Have used that paramDisplayValue('paramername'),But it
will display only last selected value.

For Example i have tree prompt with one level Region-
>country->states
If user select region Asia it will dislay the all the
Countries in that region and then if user select India it
will display the states related to india only

Suppose Hierachy look like this:
Asia->India->Andhra Pradesh.

I want to show this hierachy on the top of the report

How it is possible? Can you please help me?



Hi All, Is there any way to check whether a value is selected in a Multi-select tree prompt? I ha..

Answer / Sudhanshu Saxena

In Cognos, to get the selected values from a multi-select tree prompt and display them at the top of the report, you need to use the paramDisplayValue function in combination with array functions. Here's an example:

1. Define your multi-select tree prompt, let's call it `RegionTree`.
2. Create a new variable that will store the selected values as an array. Call this variable `SelectedRegions`.
3. In the formula of the SelectedRegions variable, use the following code:

```
array SelectedRegions = array_init();
array_append(SelectedRegions, paramDisplayValue('RegionTree'));
```
4. Now, you can access and display the selected values using `array_get()`. For example, to display the hierarchy of the last selected region, use:

```
REGION_NAME = array_get(SelectedRegions, length(SelectedRegions) - 1);
COUNTRY_NAME = // your formula to get country name for given region (e.g., using a lookup table or SQL query)
STATE_NAME = // your formula to get state names for the selected country (e.g., using a lookup table or SQL query)
Report Header: [REGION_NAME], [COUNTRY_NAME], [STATE_NAME]
```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Cognos Interview Questions

Suppose you run a report with empty data, how will you inform the end user that it has no data while running the report in report studio? Is it possible, if so how?

1 Answers  


How to change Boolean variable Yes As "TRUE" and No as "FALSE" in Cognos reporting studio?

2 Answers   Wipro,


What is the diff between Drill through reports and Master detail reports?

2 Answers   CSC, TCS,


Can anyone give me the url for cognos forum which is similar to forumtopics.com/busobj for business objects?

1 Answers   IBM,


can we join 2 different queries? One has 10 columns and other has 5+ columns?

2 Answers   IBM,


What are Governer Settings?

2 Answers  


Explain what is the difference between microstrategy and cognos reporting tool?

1 Answers  


what is a Galaxy Schema?

2 Answers   IBM,


What is the use of powerhouse?

1 Answers  


how to create relationship between emp and salgrade tables in frameworkmanager?

1 Answers   TCS,


How we check the errors before running the report,plz let me know the answer

4 Answers   TCS,


Can you explain new content durability?

1 Answers  


Categories