COGNOiSe.com - The IBM Cognos Community

Legacy Business Intelligence => COGNOS ReportNet => Topic started by: phani1979 on 07 Feb 2006 10:06:57 AM

Title: How to Calculate YTD and MTD
Post by: phani1979 on 07 Feb 2006 10:06:57 AM
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
Title: Re: How to Calculate YTD and MTD
Post by: Near on 07 Feb 2006 10:23:00 AM
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
Title: Re: How to Calculate YTD and MTD
Post by: bdybldr on 07 Feb 2006 10:34:59 AM
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.
Title: Re: How to Calculate YTD and MTD
Post by: phani1979 on 07 Feb 2006 10:58:36 AM
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
Title: Re: How to Calculate YTD and MTD
Post by: Near on 07 Feb 2006 11:39:16 AM
Sorry dude, I was confused by your question.Ã,  Check out the link below... this should help


http://wiki.ittoolbox.com/index.php/HOWTO:Provide_a_prompt_in_ReportNet_for_YTD,_MTD_and_Prior_YTD_FilteringÃ,  Ã,   (http://wiki.ittoolbox.com/index.php/HOWTO:Provide_a_prompt_in_ReportNet_for_YTD,_MTD_and_Prior_YTD_Filtering%C3%83,%C3%82%20%C3%83,%C3%82)

::)
Title: Re: How to Calculate YTD and MTD
Post by: Near on 07 Feb 2006 11:45:21 AM
http://wiki.ittoolbox.com/index.php/HOWTO:Provide_a_prompt_in_ReportNet_for_YTD,_MTD_and_Prior_YTD_Filtering
Title: Re: How to Calculate YTD and MTD
Post by: bdybldr on 07 Feb 2006 12:04:40 PM
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.
Title: Re: How to Calculate YTD and MTD
Post by: BIsrik on 12 Feb 2006 04:11:18 AM
Whats the status...

Srik
Title: Re: How to Calculate YTD and MTD
Post by: mrcool on 14 Feb 2006 03:44:06 AM
Wats the Status?
Title: Re: How to Calculate YTD and MTD
Post by: phani1979 on 14 Feb 2006 07:26:00 PM
Hai
I got It .. :) :)
Thanks for everything..  To Cognoise Team
Thank u
sudhakar
Title: Re: How to Calculate YTD and MTD
Post by: bdybldr on 15 Feb 2006 08:35:37 AM
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.