I have Date,product,Quantity_Sold columns and I want
Product, MTD(month Till date),YTD(Year Till Date) as output.


Can anyone help me with the logic in getting MTD i.e
quantity sold from 1st of this month to till date (i.e. 01-
11-2013 to 26-11-2013) and YTD i.e QTD sold from 1st date
of the year to till date(i.e. 01-01-2013 to 26-11-2013).


Sample output model:

Product MTD YTD



I have Date,product,Quantity_Sold columns and I want Product, MTD(month Till date),YTD(Year Till D..

Answer / naresh

HI All,
Follow below steps to achieve this

1) In Filter condition place the below condition (to_char([START_DATE],'YYYY')=to_char({sysdate},'YYYY') and [START_DATE] <= {sysdate})

2)Create one Derived colum as MTD and in Expression use below code

case when (to_char([START_DATE],'MM')=to_char({sysdate},'MM') and [START_DATE] <= {sysdate})
then [Quantiry] end

Next in properties if this column for aggrigate Function and for Rollup Aggrigate Function change 'automatic ' to 'None'.
3) create one more Derived column as YTD and in expression use below code
case when (to_char([START_DATE],'YYYY')=to_char({sysdate},'YYYY') and [START_DATE] <= {sysdate})
then [Quantity] end

here sysdate is oracle date function.

Thats it .

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Cognos Interview Questions

can anyone let me know some tips or interview questions on framework manager metadata modeling, creating joins, and all other aspects related to Cognos 8 framework mgr

0 Answers   TCS,


i'm searching on cognos..i want to know real time project explanation..persons having real time exp or undertaking trainings or who searching on cognos...can send me the details for project and interview preparation..pls help me out..my mail-id is al.ramu@yahoo.com hope u will respond as soon as possible..thanks..

1 Answers  


hi frnds any body have cognos projects plz send me two(or)three projects to my mail adress ramureddy.reddy4@gmail.com.

0 Answers  


How to change Boolean variable Yes As "TRUE" and No as "FALSE" in Cognos reporting studio?

2 Answers   Wipro,


How do we implement Check Box Prompt in COgnos Report Studio?

2 Answers  






What are all the types of gateway used in Cognos?

0 Answers  


can you tell me what are the dimension tables are used in project

0 Answers   GalaxE,


Can u solve a small query on table the problem is whether it is possible to add extra cells for already existed table i.e if table contains 3 rows n 4 cols (3*4) it is possible to add another cell (4*4)

1 Answers  


what is filter?give me one example that you created a report in your project?

3 Answers   IBM,


what are burst options you have?

2 Answers   HCL, IBM, TCS,


What is the difference between macro & Parameter

1 Answers   IBM,


What actually a project contains?

0 Answers  


Categories