If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

How to Calculate YTD and MTD

Started by phani1979, 07 Feb 2006 10:06:57 AM

Previous topic - Next topic

phani1979

Hello to everyone
I need to calculated YTD and MTD
From the prompt if the users select  YTD then it should display the YTD data.If MTD then it should display MTD data.
I had data fields like(example of gosales)
ProdcutName
Year,Month,SalesTarget,Actual Revenue.

Can u help me guys,How to calculate YTD and MTD ,i should do it report studio.
I appreciate step by step
Thank u
sudhakar

Near

I'm assuming this prompt is on the same page as the list for your query results. If it is, you could base your query on the selection made from a dropdown (YTD or MTD) and execute it via a Reprompt. 

Although I would shy away from using a condition here (All conditional block SQL will run regardless of how the conditional attributes are set) if the expected results are small the additional processing shouldn't affect performance much. 

If the prompt is on a prompt page and the results are on a standard data page you can do the same thing but using a reprompt will be unnecessary. Basically the prompt will determine which query to use.

In terms on a step by step...you are kidding right?
;D

bdybldr

Sudhakar,
What exactly are you asking?  Do you need to know how to define YTD and MTD calculations? or Do you need to know how to create a conditional block list?  Please be more specific.

phani1979

Hey
Thanks for ur replies.
I know How to do conditional block.I am not kidding..
I want to know how do we calculate YTD and MTD with those field.
I need the syntax., it might by an easy one, I have no idea and I haven't done that
Se Please help me
sudhakar

Near



bdybldr

#6
Create a filter for MTD and YTD as below:

MTD: extract(month, [TransactionDate]) = extract(month, {sysdate})

YTD: extract(year, [TransactionDate]) = extract(year, {sysdate})

NOTE: I assume you're using an Oracle DB

If this isn't what you're looking for, let me know.

BIsrik


mrcool


phani1979

Hai
I got It .. :) :)
Thanks for everything..  To Cognoise Team
Thank u
sudhakar

bdybldr

Sudhakar, please follow the rules of this board and close your issues when solved.

Go to your very first posting and click "modify."

Type "[Solved]" in front of the subject and then click the "save" button at the bottom.

We need everyone's help to keep this board organized.  Thanks.