If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

FM- Operator as a prompt

Started by testuser, 21 Mar 2007 07:23:55 AM

Previous topic - Next topic

testuser

I would like to create a prompt for an Operator sign - > or < or = or <> etc.
I will be using it as part of an SQL (Query subject) for example

select *
from
Ã,  Ã,  Ã,  Ã,  tablea
where
Ã,  Ã,  Ã,  Ã,  b promptA(< or > or = or <>) #prompt('Country')#.



Thanks,

MFGF

Hi,

Why not just extend your expression to use another prompt macro for the operator as well?

For example:

select *
from
        tablea
where
        b.promptA #prompt('Operator','token','=')# #prompt('Country')#

Best regards,

MF
Meep!

testuser

Thank you for the reply. I will try that. But what would the datatype be - is token a string?
How do I go about storing > , <, = so that users could choose it from a drop down menu?

Thank you for your help

MFGF

Hi,

The Token datatype is used where you want to pass the results of the prompt back as entered.  If you used a string datatype, the entered value would be encapsulated in quotes, which would not be legal syntax in this part of the expression.

To give the users a dropdown list of operators, you will need to add a value prompt to your report.  In the properties of the prompt, make sure it is connected to your 'Operator' parameter, and add static choices for each operator you want displayed.

Hope that helps,

MF.
Meep!

COGNOiSe administrator

You could also use compund filter, meanning

( #prompt('Choise')#=1 and Country>#prompt('Country')# )
or
( #prompt('Choise')#=2 and Country<#prompt('Country')# )
or
( #prompt('Choise')#=3 and Country=#prompt('Country')# )
or
( #prompt('Choise')#=4 and Country<>#prompt('Country')# )

testuser

Thank you all. I was able to get the report working. Appreciate all your help.