COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Query Studio => Topic started by: james899 on 21 Jan 2011 12:15:16 PM

Title: How does a new user create a combined if-then, math and boolean calculation?
Post by: james899 on 21 Jan 2011 12:15:16 PM
I came from using Hyperion and I could create a computed item with a complex expressions in both the query side and the result or report side. I want to combine if-then-else logic with mathmatical, boolean, and special functions all in one expressions. A simple example is below.

if (sales >= 1000) AND (margin >= 2.5)
Then round(((sales * bonus)/ month_days), 2)
else round(sales/ month_days), 2)
Title: Re: How does a new user create a combined if-then, math and boolean calculation?
Post by: MFGF on 22 Jan 2011 03:49:25 AM
Hi,

Creating these kinds of complex, expression-based calculations is beyond the capabilities of Query Studio, sorry. You would either need to have the calculation pre-defined as an item in your package by your Framework Manager modeller, or else use Report Studio if you want to define these calcs yourself in the report.

Regards,

MF.
Title: Re: How does a new user create a combined if-then, math and boolean calculation?
Post by: james899 on 26 Jan 2011 10:25:26 AM
Thank you for the reply. This is a shift for me. Reporting was formatting the query output into a graph or pivot and while I can do calculations at that step like a percentage, the major calculations were in the query. You are saying that with Cognos, the report studio does both the formatting and all the complex calculations. So case statements and if/then expressions are used in report studio and not queries?
Title: Re: How does a new user create a combined if-then, math and boolean calculation?
Post by: MFGF on 27 Jan 2011 06:09:34 AM
The studios in Cognos 8 are simply user interfaces to allow reports to be defined.  Queries are generated at runtime based on both the underlying package definitions and the grouping/calculations/filters etc defined within the report.

Query Studio is targeted at Business Authors who have little or no technical experience, and consequently the UI is task-oriented, simple to use, and avoids use of complex expression editors.  Report Studio is for professional authors (power users) with much better technical skills, and allows use of expressions, manipulation of query items, multi-query reports etc.

Regards,

MF.