COGNOiSe.com - The IBM Cognos Community

IBM Cognos Analytics Platform => Cognos Analytics => Reporting => Topic started by: Good Friend on 23 Dec 2024 02:09:37 PM

Title: ******* Passing Multiple Comma separated values into text box prompt *********
Post by: Good Friend on 23 Dec 2024 02:09:37 PM
Hello Friends,

I'm looking for a prompt functionality in Cognos Analytics that allows users to input multiple values, such as 01,02,03,04,05 into a text box or similar prompt. While a search-and-select option is already provided, users prefer a comma-separated input method to enter all values simultaneously. The goal is to dynamically filter the query based on these inputs. I've tried using prompt macros but haven't had success. Any insights, suggestions, or workarounds would be greatly appreciated. Thank you!
Title: Re: ******* Passing Multiple Comma separated values into text box prompt *********
Post by: dougp on 02 Jan 2025 01:36:39 PM
Would <ENTER> delimited work?  The textbox prompt has a multi-line property.
Title: Re: ******* Passing Multiple Comma separated values into text box prompt *********
Post by: Warm on 05 Mar 2025 03:18:17 AM
I've used the following filters,

1. Filter with values with comma and spaces (example: test, test1, test2, test3)

[DATA COLUMN] in (#csv( split(',', prompt('PROMPTNAME', 'token') ) )#)

2. Filter values without spaces but with comma (example: 01,02,03,test1)

((#sq(prompt(''PROMPTNAME'', 'token', 'testValue'))# <> 'testValue') and [DATA COLUMN] in (#csv( split(',', substitute(' ','', prompt(''PROMPTNAME'', 'token')) ) )#) ) or ((#sq(prompt(''PROMPTNAME'', 'token', 'testValue'))# = 'testValue'))

Hope this helps