Author Topic: Display the Paramater Values in the report one after ther instead commas  (Read 417 times)

Offline New@cog

  • Community Leader
  • *****
  • Join Date: Oct 2011
  • Posts: 98
  • Forum Citizenship: +0/-0
Hi Everyone,

I have a requirement where when I select multiple values in a prompt, those values should be shown on report page.
Usually Cognos displays the values with comma separated. But, my requirement is to display one below the other instead of comma separated.

Ex: If values A,B,C,D,E is selected in the prompt then on my report page it should be displayed as

A
B
C
D
E
 instead A,B,C,D,E

If I use list to get this I need a separate query for this which reviewer is not accepting .
Please let me know if anybody have any other alternative solution for this.

Thanks in Advance !

Offline New_Guy

  • Statesman
  • ******
  • Join Date: Mar 2016
  • Posts: 274
  • Forum Citizenship: +14/-0
Hi,
How many characters are the parameters, are they fixed length? if they are fixed length then place them in a block of fixed width and then they will appear one below the other with a comma at the end.

One more option is to use the same query item that is getting the parameters, from the main query that you are creating the list or crosstab and use it in the other list for displaying the parameter. you dont have to create another query for just this purpose.
Good luck
New guy

Offline bdbits

  • Super Moderator
  • Statesman
  • ******
  • Join Date: Feb 2010
  • Posts: 1,781
  • Forum Citizenship: +104/-0
Not somewhere I can test this out right now, but something like this might work to split up the elements where your prompt is called pValues.

#csv(split(',', 'pValues'))#

Offline CognosPaul

  • Global Moderator
  • Statesman
  • *****
  • Join Date: Jan 2009
  • Posts: 1,566
  • Forum Citizenship: +244/-1
    • Paul's Cognos Blog
I had a similar requirement once.

Create a new query and data item with the following expression:
Code: [Select]
#
sq(
'<ol><li>'+
join('</li><li>',split(';',promptmany('param','token')))
+'</li></ol>'
)
#
OR
Code: [Select]
#
sq('<div><span>'+
join('</span></div><div><span>',split(';',promptmany('test','token')))
+'</span></div>'
)
#

Then create a singleton based on that query, pull in a rich text item, and set the data item as the value for the rich text item.

Offline bdbits

  • Super Moderator
  • Statesman
  • ******
  • Join Date: Feb 2010
  • Posts: 1,781
  • Forum Citizenship: +104/-0
I'd go with what CognosPaul writes any day of the week.   8)

 


       
Twittear