COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Framework Manager => Topic started by: bucky on 09 Oct 2009 02:24:17 PM

Title: calculation that returns boolean
Post by: bucky on 09 Oct 2009 02:24:17 PM
Does framework manager support returning boolean values for a calculation? I'm trying to do something like this:

if (...)
then (true)
else (false)

But it's invalid.
Title: Re: calculation that returns boolean
Post by: angela on 12 Oct 2009 02:19:59 PM
It absolutely should work.  The problem might be with your actual calculation or where you're putting it - directly in the SQL or in a Calculated Column.
Title: Re: calculation that returns boolean
Post by: blom0344 on 13 Oct 2009 02:40:31 AM
AFAIK an if then else will always yield a value (whether 0/1 or any other combo) Since it will return either 1 of the values you can treat it like a Boolean I guess
Title: Re: calculation that returns boolean
Post by: rockytopmark on 13 Oct 2009 08:30:31 AM
True and false are just strings in context for which you are using them.  Your syntax is invalid since you don't have single quotes around the string values.

If(...)
Then('True')
Else('False')

As Blom suggested, treat it like a boolean, but it will not be a true boolean in the data type sense.