Solved

Cognos 8 calculating with prompts

Posted on 2008-06-14
3
772 Views
Last Modified: 2010-04-29
Hi

I am creating a cognos report that uses date prompts, when you run the report you enter a start date and an end date. What i would like to do is make a calulation on the results of a query based on the number of months between the start and end dates entered for example

if the number of months between the start and end date entered is 12 I would like to multiply a query result by 12 and then Divide by 2 but if the number of months between the start and end date entered is only 1 I would just like to multiply by 12.

Can anyone make any suggestions please.

Adam
0
Comment
Question by:ac_davis2002
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
ibrusett earned 500 total points
ID: 21786398
I think this is a Cognos issue...
But anyway, you can use SQL server function inside cognos report, so try to create a calculated field on your two date paramenters using DATEDIFF:

DATEDIFF ( mm, startdate , enddate ) gives you the difference in months between the two dates.
Use this calculation to create an if statement to obtain the correct product!
0
 

Author Comment

by:ac_davis2002
ID: 21788107
EXCELLENT
THANKS!!!
0
 

Author Closing Comment

by:ac_davis2002
ID: 31467229
Thanks again
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to increase the row limit in Jasper Server.
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question