Solved

Cognos 8 calculating with prompts

Posted on 2008-06-14
3
745 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
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
ibrusett earned 500 total points
Comment Utility
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
Comment Utility
EXCELLENT
THANKS!!!
0
 

Author Closing Comment

by:ac_davis2002
Comment Utility
Thanks again
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
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.

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now