COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Framework Manager => Topic started by: Cynder on 12 Jun 2017 07:30:25 PM

Title: Prompt function error in filter
Post by: Cynder on 12 Jun 2017 07:30:25 PM
Hi all,

I'm working with FM v10.2.2 plus all fix packs (just upgraded from v10.2.1). I tried creating a simple filter with a prompt function on a query subject and got a strange error that I hadn't seen before. Syntax was as follows:
[Sales and marketing data].[SLS_PRODUCT_LINE_LOOKUP].[PRODUCT_LINE_CODE] = #prompt('PLC')#
The model I am using is the standard IBM great_outdoors_warehouse model.
The error I got occurred when I closed the filter dialog box - it was just a nondescript error dialog, no message just the red circle/white X error icon. And, my syntax was wiped out (deleted).
I tried the exact same syntax with ?PLC? and it worked OK. I also tried the #prompt('PLC')# syntax with a Cognos Analytics 11.0.6 dev box and it worked OK.
So I'm stumped. Any clues would be greatly appreciated.

- c
Title: Re: Prompt function error in filter
Post by: MFGF on 13 Jun 2017 03:31:07 AM
Quote from: Cynder on 12 Jun 2017 07:30:25 PM
Hi all,

I'm working with FM v10.2.2 plus all fix packs (just upgraded from v10.2.1). I tried creating a simple filter with a prompt function on a query subject and got a strange error that I hadn't seen before. Syntax was as follows:
[Sales and marketing data].[SLS_PRODUCT_LINE_LOOKUP].[PRODUCT_LINE_CODE] = #prompt('PLC')#
The model I am using is the standard IBM great_outdoors_warehouse model.
The error I got occurred when I closed the filter dialog box - it was just a nondescript error dialog, no message just the red circle/white X error icon. And, my syntax was wiped out (deleted).
I tried the exact same syntax with ?PLC? and it worked OK. I also tried the #prompt('PLC')# syntax with a Cognos Analytics 11.0.6 dev box and it worked OK.
So I'm stumped. Any clues would be greatly appreciated.

- c

Hi,

I always advocate the use of the second parameter in a prompt() macro function. This dictates the data type of the parameter. In your case I'd use an integer data type:

#prompt('PLC','integer')#

If you don't want the value to be messed with (eg string values are returned in single quotes), use 'token' as the data type, eg

#prompt('PLC','token')#

Cheers!

MF.
Title: Re: Prompt function error in filter
Post by: Cynder on 13 Jun 2017 05:25:18 PM
Thanks for the response and suggestion.
I tried inserting other parameters (data type, default value), but unfortunately came up with the same result.
And that error dialog box is so strange. No message, just the error icon. Almost like its crashing or something, But FM doesn't crash, just the Filter dialog - very strange.

- c