Author Topic: Calculation Expression--HELP!  (Read 659 times)

Offline ADW

  • Full Member
  • ***
  • Posts: 5
  • Forum Citizenship: +0/-0
Calculation Expression--HELP!
« on: 24 Oct 2007 04:08:26 am »
I have been trying to figure this out for weeks with no luck. Unfortuantely, due to my mind thinking in Excel term versus Cognos 8 ReportNet terms, I need assistance figuring out how to create and represent an expression in a Report I'm creating. I have a column from a DB I'm mapping to that has integer data representing a duration of time. What the end user wants is a conditional expression that does the following

IF [package].
.[data-item]>=7

   THEN (Count([package].
.[data-item])/(Count(Rows))

Seems simple enough, but:

  1) How or Where would I place that expression in a cell/column/page by itself
  2) I keep getting parsing errors when I try to do a count of [package].
.[data-item]>=7
  2) I can't get the expression to validate nor can I get half of the condition to validate and keep getting parsing errors.

Thanks in advance!
« Last Edit: 24 Oct 2007 04:11:44 am by ADW »

Offline rockytopmark

  • Statesman
  • ******
  • Posts: 443
  • Forum Citizenship: +37/-0
Re: Calculation Expression--HELP!
« Reply #1 on: 24 Oct 2007 04:59:36 am »
Keep it simple...  Set the value to 1 if it meets the criteria or 0 if not.

Then simply let the aggregation handle the math.

Create a Query Item, "7 or better":
IF ([package]..[data-item]>=7) THEN (1) ELSE (0)

Then to get your ratio, divide the count of the rows by this query item.

This of course will not make much sense in a detail report, but in a summarized report (where there is some level of grouping and therefore, some aggregation) it will get you your result.

Offline ADW

  • Full Member
  • ***
  • Posts: 5
  • Forum Citizenship: +0/-0
Re: Calculation Expression--HELP!
« Reply #2 on: 24 Oct 2007 06:27:16 am »
Thanks, I will give that a try.