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

Detail filter expression

Started by Avisto.sbu, 13 Mar 2014 10:41:14 AM

Previous topic - Next topic

Avisto.sbu

Hi,

I have a field named 'terminal' and I don't want this field to be mandatory, the default behaviour should be that all terminals are selected in the report if there is no selection.

So I tried to create a filter :


if(?selection terminal QS?  is missing)
then([(en-zw) Nouvel espace-noms4].[(en-zw) Raccourci de pdv].[(en-zw) shop_terminal] = [(en-zw) Nouvel espace-noms4].[(en-zw) Raccourci de pdv].[(en-zw) shop_terminal])
else([(en-zw) Nouvel espace-noms4].[(en-zw) Raccourci de pdv].[(en-zw) shop_terminal] = ?selection terminal QS?)


Obviously it is not working as I don't know report studio syntax and I don't find any tutorial about the syntax in filters
the parameter becomes mandatory as soon as I put a filter in the main query :(

actually I want to filter a value when something is selected, and when nothing is selected, every values are used for the main query.
I think we can't create a if without a 'else' so that's why I put value=value in the 'Then'

How can I do?

thanks for your answers

BigChris

Hi - I think you just need to make the filter optional. That if the user selects a value it'll use it in the filter...and not if they don't.

Avisto.sbu

#2
thanks for your answer,

as the 'else' condition is mandatory in the filter syntax what should I do if I want nothing to be done in that condition without having a sql error?
for example if I modify the previous query I could have:


if(?selection terminal QS?  is not missing)
then( [(en-zw) Nouvel espace-noms4].[(en-zw) Raccourci de Point de vente].[(en-zw) shop_terminal]= ParamDisplayValue('selection terminal QS'))
else(1=1)

[\code]
But it is not working I have a sql error

BigChris

I think you can just change your filter to be:

[(en-zw) Nouvel espace-noms4].[(en-zw) Raccourci de Point de vente].[(en-zw) shop_terminal]= ?selection terminal QS?

and make the filter optional.

Can I just check - is this a relational model, or a dimensional one?

Avisto.sbu

thank you very much it works :)

it is a dimensional model

bdbits

You really should not use filters on dimensional sources. CognosPaul has explained this many times in various places. Here is one.

http://www.cognoise.com/community/index.php?topic=18290.0;topicseen