adspace
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 Posted / 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 View All Answers
hi, this is harish. i had finsihed cognos course recently.can some one help in the area of project explination, interview questions,real time scenarious....this is my maild id nanagupta907@gmail.com
what are the dimensions that you have in your current project?list them?
can anyone provide link to download cognos 7.2 version for download along wiht installation and configuration steps tx in advance
What r the names of the reports that you prepared?
Hi I need real time senarios and how to explain project in the interview pls let me know my email id m.n.prathyusha@gmail.com.Please help me out with this pls pls pls muthireddi@gmail.com
hi all i am searching for cognos jobs pls inform about the jobs to:santosh.koora@gmail.com
hi frnds any body have cognos projects plz send me two(or)three projects to my mail adress ramureddy.reddy4@gmail.com.
i'm searching on cognos..i want to know real time scenarios..persons having real time exp or undertaking trainings or who searching on cognos...can send me the details...for proper guidence..for project and interview preparation..pls help me out..my mail-id is ammu2india@gmail.com..hope u will respond as soon as possible..thanks..
Hi, I'm planning to write COG-132 exam so looking out for dumps. If anybody is having then please e-mail me at afrinshaikh86@gmail.com. your help would be appreciated. -Regards Afrin
Does anybody have the sample of delivery document of cognos, or provide some link of websites Thanks
what are the names of the reports that you prepared?
hi..i'm searching on cognos.i want to know some real time explanation..persons who have real time exp and who r searching in this field..can u send ur mail-id..my mail-id is dhaanuus@gmail.com..hope u will respond as soon as possible..
faq's on cognos