COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: MikeLanglois on 18 Jan 2018 05:25:02 AM

Title: Update SQL With Prompt Input
Post by: MikeLanglois on 18 Jan 2018 05:25:02 AM
Hey all,

I have some SQL input on a query that has:

WHERE
SD.YEAR_NUM = 2016

and I was wondering if its possible to have this be updated with values from a prompt? The prompt will be a selection of years.

Also the script has:

SD.MONTH_NUM_OF_YEAR in (4,5,6)

would it be possible to have the 4,5,6 be updated based on the multiple choices on a prompt?

Is it the usual ?prompt? syntax used in Cognos filters, or is it something else?

Many thanks
Title: Re: Update SQL With Prompt Input
Post by: RubenvdLinden on 18 Jan 2018 01:32:53 PM
You can add prompt macros to your SQL statement, e.g.

SD_YEARNUM = #prompt('year';'integer')#

Use promptmany for multiple values.