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?
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 |
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?
How to change Boolean variable Yes As "TRUE" and No as "FALSE" in Cognos reporting studio?
What is the diff between Drill through reports and Master detail reports?
Can anyone give me the url for cognos forum which is similar to forumtopics.com/busobj for business objects?
can we join 2 different queries? One has 10 columns and other has 5+ columns?
What are Governer Settings?
Explain what is the difference between microstrategy and cognos reporting tool?
what is a Galaxy Schema?
What is the use of powerhouse?
how to create relationship between emp and salgrade tables in frameworkmanager?
How we check the errors before running the report,plz let me know the answer
Can you explain new content durability?