Hello,
I created a report where I have a prompt with variable >pBereich<. This prompt is based on a query and have also a static value >ALLOBJ< ("All objects"). The report works as expected.
We are using Cognos Analytics version = 11.2.4 FP4
Now I want to add a new column in the output (simple list based on queries) where I using the variable. The column/calculation I add looks like:
if (?pBereich? = 'ALLOBJ')
then
(
replace ([OBJSP] ; '/content' ; '')
)
else
(
replace ([OBJSP] ; ?pBereich? ; '')
)
As long as the prompt is used with >ALLOBJ< the report give a result (as expected).
Selecting a value from the prompt list, the result (the simple list) is empty.
Basically, it is completely irrelevant what the value of the variable is. Either the replace function does something or it does not, but in any case a text should be returned.
If I change the line
replace ([OBJSP] ; ?pBereich? ; '')
to
'dummy text'
or
?pBereich?
then the report works normal / as before, showing 'dummy text' or the value I selected in the prompt.
(using 'dummy text' + ?pBereich? also result in empty list)
Is this beaviour right or wrong? I assume it is wrong - but why and what do I have to do to be able to use the variable in the column/calculation?
Note:
Using another variable from another (static values only) prompt like this:
'any text + ' + ?pSourceType?
I do not get this empty result behaviour - but the output is:
any text + /content%
No idea why there is this % character at the end of the output, because the static value for variable pSourceType is only /content
Thanks
Michael
------------------------------
MichaelHaass
------------------------------