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
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.
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
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?
thank you very much it works :)
it is a dimensional model
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
(http://www.cognoise.com/community/index.php?topic=18290.0;topicseen)